不送检的质量检查单状态更新:等待、待处理
This commit is contained in:
@@ -1198,11 +1198,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'cmm_ids': production.workorder_ids.filtered(lambda t: t.routing_type == 'CNC加工').cmm_ids,
|
||||
}]
|
||||
return workorders_values_str
|
||||
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state',
|
||||
'production_id.tool_state', 'production_id.schedule_state', 'sequence',
|
||||
'production_id.programming_state')
|
||||
def _compute_state(self):
|
||||
def _process_compute_state(self):
|
||||
for workorder in self:
|
||||
# 如果工单的工序没有进行排序则跳出循环
|
||||
if workorder.production_id.workorder_ids.filtered(lambda wk: wk.sequence == 0):
|
||||
@@ -1289,7 +1285,20 @@ class ResMrpWorkOrder(models.Model):
|
||||
mo.get_move_line(workorder.production_id, workorder))
|
||||
else:
|
||||
workorder.state = 'waiting'
|
||||
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state',
|
||||
'production_id.tool_state', 'production_id.schedule_state', 'sequence',
|
||||
'production_id.programming_state')
|
||||
def _compute_state(self):
|
||||
self._process_compute_state()
|
||||
for workorder in self:
|
||||
if workorder.state == 'waiting' or workorder.state == 'pending':
|
||||
for check_id in workorder.check_ids:
|
||||
if not check_id.is_inspect:
|
||||
check_id.quality_state = 'waiting'
|
||||
if workorder.state == 'ready':
|
||||
for check_id in workorder.check_ids:
|
||||
if not check_id.is_inspect:
|
||||
check_id.quality_state = 'none'
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
# 判断工单状态是否为等待组件
|
||||
|
||||
Reference in New Issue
Block a user