外协调拨单不同产品的调拨单混合到一起了
This commit is contained in:
@@ -502,6 +502,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
# if technology_design.is_auto is False:
|
||||
# domain = [('origin', '=', self.production_id.name)]
|
||||
# else:
|
||||
|
||||
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||
result = {
|
||||
"type": "ir.actions.act_window",
|
||||
@@ -1297,6 +1298,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
move_out = picking_id.move_ids
|
||||
# move_out = workorder.move_subcontract_workorder_ids[1]
|
||||
for mo in move_out:
|
||||
if workorder.production_id.bom_id.bom_line_ids.product_id.id != move_out.product_id:
|
||||
continue
|
||||
if mo.state != 'done':
|
||||
mo.write({'state': 'assigned', 'production_id': False})
|
||||
if not mo.move_line_ids:
|
||||
@@ -1338,6 +1341,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
wk: wk.location_id.name == '制造前' and wk.location_dest_id.name == '外协加工区')
|
||||
move_out = picking_id.move_ids
|
||||
for mo in move_out:
|
||||
if workorder.production_id.bom_id.bom_line_ids.product_id.id != move_out.product_id:
|
||||
continue
|
||||
if mo.state != 'done':
|
||||
mo.write({'state': 'assigned', 'production_id': False})
|
||||
if not mo.move_line_ids:
|
||||
@@ -1421,6 +1426,8 @@ class ResMrpWorkOrder(models.Model):
|
||||
# [('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||
# ('origin', '=', self.production_id.name), ('state', 'not in', ['cancel', 'done'])])
|
||||
for mo in move_out:
|
||||
if self.production_id.bom_id.bom_line_ids.product_id.id != move_out.product_id:
|
||||
continue
|
||||
if mo.state != 'done':
|
||||
mo.write({'state': 'assigned', 'production_id': False})
|
||||
if not mo.move_line_ids:
|
||||
|
||||
@@ -131,6 +131,8 @@ class PurchaseOrder(models.Model):
|
||||
lambda wk: wk.location_id.name == '制造前' and wk.location_dest_id.name == '外协加工区')
|
||||
move_out = picking_id.move_ids
|
||||
for mo in move_out:
|
||||
if production_id.bom_id.bom_line_ids.product_id.id != move_out.product_id:
|
||||
continue
|
||||
if mo.state != 'done':
|
||||
mo.write({'state': 'assigned', 'production_id': False})
|
||||
if not mo.move_line_ids:
|
||||
|
||||
Reference in New Issue
Block a user