调整程序写入逻辑

This commit is contained in:
mgw
2025-02-08 16:00:07 +08:00
parent 44f29d001e
commit 976d75973d
2 changed files with 4 additions and 3 deletions

View File

@@ -1295,7 +1295,7 @@ class MrpProduction(models.Model):
for rework_item in rework_workorder:
pending_workorder = production.workorder_ids.filtered(
lambda m1: m1.state in [
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type == 'CNC加工')
'pending'] and m1.processing_panel == rework_item.processing_panel and m1.routing_type in ['CNC加工', '人工线下加工'])
if not pending_workorder.cnc_ids:
production.get_new_program(rework_item.processing_panel)
# production.write({'state': 'progress', 'programming_state': '已编程', 'is_rework': False})
@@ -1338,7 +1338,7 @@ class MrpProduction(models.Model):
if productions:
for production in productions:
panel_workorder = production.workorder_ids.filtered(lambda
pw: pw.processing_panel == processing_panel and pw.routing_type == 'CNC加工' and pw.state not in (
pw: pw.processing_panel == processing_panel and pw.routing_type in ['CNC加工', '人工线下加工'] and pw.state not in (
'rework', 'done'))
if panel_workorder:
if panel_workorder.cmm_ids: