1、优化工单状态
This commit is contained in:
@@ -50,6 +50,7 @@ class MrpProduction(models.Model):
|
||||
def _compute_tool_state(self):
|
||||
for item in self:
|
||||
if item.workorder_ids:
|
||||
tool_state = item.tool_state
|
||||
workorder_ids = item.workorder_ids.filtered(lambda a: a.state not in ('rework', '返工'))
|
||||
if workorder_ids.filtered(lambda a: a.tool_state == '2'):
|
||||
item.tool_state = '2'
|
||||
@@ -57,6 +58,10 @@ class MrpProduction(models.Model):
|
||||
item.tool_state = '1'
|
||||
else:
|
||||
item.tool_state = '0'
|
||||
if tool_state == '2' and item.tool_state != '2':
|
||||
item.detection_result_ids.filtered(
|
||||
lambda a: a.detailed_reason == '无效功能刀具' and a.handle_result == '待处理').write(
|
||||
{'handle_result': '已处理'})
|
||||
|
||||
# state = fields.Selection(selection_add=[
|
||||
# ('pending_scheduling', '待排程'),
|
||||
|
||||
Reference in New Issue
Block a user