优化制造订单

This commit is contained in:
jinling.yang
2024-11-15 18:06:32 +08:00
parent 8add4b5ad1
commit 5c5606749a
4 changed files with 39 additions and 38 deletions

View File

@@ -96,15 +96,14 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
workorders_values.append(
self.env['mrp.workorder'].json_workorder_str(special.production_id, special))
special.production_id.write({'workorder_ids': workorders_values})
special.production_id.get_subcontract_pick()
else:
if len(workorder.blocked_by_workorder_ids) > 1:
if workorder.sequence == 1:
workorder.blocked_by_workorder_ids = None
else:
workorder.blocked_by_workorder_ids = blocked_by_workorder_ids[0]
special.production_id._reset_work_order_sequence()
special.production_id.get_subcontract_pick_purchase()
productions._reset_work_order_sequence()
productions.get_subcontract_pick_purchase()
for item in productions:
workorders = item.workorder_ids.filtered(lambda wo: wo.state not in ('cancel')).sorted(
key=lambda a: a.sequence)