diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 61461dde..82588ffe 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -78,7 +78,7 @@ class MrpProduction(models.Model): @api.depends( 'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', - 'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state') + 'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state', 'process_state') def _compute_state(self): for production in self: if not production.state or not production.product_uom_id: @@ -110,15 +110,15 @@ class MrpProduction(models.Model): production.state = 'progress' # 新添加的状态逻辑 - if production.state == 'progress' and production.schedule_state == '已排': + if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹': # production.state = 'pending_processing' production.state = 'pending_cam' if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待加工': # if production.state == 'pending_cam' and production.process_state == '待加工': production.state = 'pending_processing' - elif production.state == 'pending_processing' and production.process_state == '待解除装夹': + elif production.state == 'progress' and production.process_state == '待解除装夹': production.state = 'pending_era_cam' - elif production.state == 'pending_era_cam' and production.process_state == '已完工': + elif production.state == 'progress' and production.process_state == '已完工': production.state = 'completed' elif production.state == 'progress' and production.work_order_state == '已完成': production.state = 'completed'