Accept Merge Request #2118: (feature/tool_standard_library_process -> develop)
Merge Request: sf-制造-工艺外协的采购订单确认后,外协的调拨单的作业详情的预留数量跟完成数量不对 Created By: @廖丹龙 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @廖丹龙 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2118
This commit is contained in:
@@ -1276,14 +1276,19 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# for move_line in move.move_line_ids
|
# for move_line in move.move_line_ids
|
||||||
# )
|
# )
|
||||||
if (workorder.production_id.production_type == '人工线下加工'
|
if (workorder.production_id.production_type == '人工线下加工'
|
||||||
and workorder.production_id.programming_state == '已编程'):
|
):
|
||||||
# and workorder.production_id.programming_state == '已编程'
|
# and workorder.production_id.programming_state == '已编程'
|
||||||
if workorder.is_subcontract is True:
|
if workorder.is_subcontract is True:
|
||||||
if workorder.production_id.state == 'rework':
|
if workorder.production_id.state == 'rework':
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
continue
|
continue
|
||||||
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||||
if purchase_orders_id.state == 'purchase':
|
purchase_count = 0
|
||||||
|
for purchase_order in purchase_orders_id:
|
||||||
|
for purchase_order_line in purchase_order.order_line:
|
||||||
|
if purchase_order_line.product_id.server_product_process_parameters_id.id == workorder.surface_technics_parameters_id.id:
|
||||||
|
purchase_count = purchase_order_line.product_qty
|
||||||
|
if purchase_orders_id.state == 'purchase' and purchase_count>=workorder.production_id.product_qty:
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
picking_id = workorder.production_id.picking_ids.filtered(
|
picking_id = workorder.production_id.picking_ids.filtered(
|
||||||
lambda wk: wk.location_id.name == '制造前' and wk.location_dest_id.name == '外协加工区')
|
lambda wk: wk.location_id.name == '制造前' and wk.location_dest_id.name == '外协加工区')
|
||||||
|
|||||||
Reference in New Issue
Block a user