1、修复feature/修复工单cnc校验bug

This commit is contained in:
yuxianghui
2024-07-23 15:46:15 +08:00
parent 167c280fa4
commit 1d271d9167
3 changed files with 18 additions and 7 deletions

View File

@@ -122,7 +122,7 @@ class MrpProduction(models.Model):
is_scrap = fields.Boolean('是否报废', default=False)
@api.depends(
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', 'tool_state',
'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state')
def _compute_state(self):
for production in self:
@@ -182,6 +182,9 @@ class MrpProduction(models.Model):
for wo in
production.workorder_ids):
production.state = 'rework'
# 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工
if production.tool_state == '2':
production.state = 'rework'
def action_check(self):
"""