Commit 660a95e6 by liuyongcheng

fix 委外发货app添加工单编号

parent ac43058e
...@@ -36,14 +36,16 @@ class InheritEntrustOrderMain(Main): ...@@ -36,14 +36,16 @@ class InheritEntrustOrderMain(Main):
work_id = http.request.jsonrequest.get('work_id') work_id = http.request.jsonrequest.get('work_id')
if work_id: if work_id:
work_order = http.request.env['roke.work.order'].search([('id', '=', int(work_id))]) work_order = http.request.env['roke.work.order'].search([('id', '=', int(work_id))])
product_list = self._prepare_entrust_send_product_from_process(work_order.process_id, work_order) default_routing = work_order.product_id.routing_id
bom_line = default_routing.line_ids.filtered(lambda r: r.process_id == work_order.process_id)
product_list = self._prepare_entrust_send_product_from_process(bom_line, work_order)
res.update({"info": product_list}) res.update({"info": product_list})
return res return res
def _prepare_entrust_send_product_from_process(self, process, work_order): def _prepare_entrust_send_product_from_process(self, bom_line, work_order):
"""准备接口/entrust/send/product中的product_list数据""" """准备接口/entrust/send/product中的product_list数据"""
product_list = [] product_list = []
for i in process.p_bom_ids: for i in bom_line.p_bom_ids:
product_list.append({ product_list.append({
"product_id": i.product_id.id, "product_id": i.product_id.id,
"product_name": i.product_id.name, "product_name": i.product_id.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment