优化制造订单菜单

This commit is contained in:
jinling.yang
2024-07-04 17:31:03 +08:00
parent 050e82673a
commit 52fa229896
5 changed files with 82 additions and 16 deletions

View File

@@ -102,6 +102,9 @@ 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.test_results == '返工' and wo.state == 'done' for wo in production.workorder_ids):
production.state = 'rework'
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,