1,修复制造订单状态:第一张装夹工单未就绪是,状态需为:待加工;所有工单完成后,状态需为:完成;2.修复多个产品确认制造订单未生产多个编程单问题3.优化工单页面:去掉非必要的字段

This commit is contained in:
jinling.yang
2024-06-30 11:45:52 +08:00
parent 5668722109
commit 4a648fbd7b
6 changed files with 20 additions and 36 deletions

View File

@@ -102,7 +102,7 @@ class MrpProduction(models.Model):
elif not production.workorder_ids and float_compare(production.qty_producing, production.product_qty,
precision_rounding=production.product_uom_id.rounding) >= 0:
production.state = 'to_close'
elif any(wo_state in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
elif any(wo_state in ('progress') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'progress'
elif production.product_uom_id and not float_is_zero(production.qty_producing,
precision_rounding=production.product_uom_id.rounding):
@@ -119,6 +119,10 @@ class MrpProduction(models.Model):
production.state = 'confirmed'
# if production.schedule_state == '已完成':
# production.state = 'completed'
elif production.workorder_ids and production.workorder_ids[0].state == 'ready':
production.state = 'confirmed'
elif all(wo_state in ('done') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'done'
elif any(wo_state in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'progress'
elif production.product_uom_id and not float_is_zero(production.qty_producing,
@@ -128,9 +132,6 @@ class MrpProduction(models.Model):
precision_rounding=move.product_uom.rounding or move.product_id.uom_id.rounding)
for move in production.move_raw_ids):
production.state = 'progress'
# if production.state == 'progress' and production.schedule_state == '已排' and production.process_state == '待装夹':
# # production.state = 'pending_processing'
# production.state = 'pending_cam'