Merge branch 'feature/设备维保优化' into feature/工单状态优化
This commit is contained in:
@@ -1051,6 +1051,17 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if workorder.production_id.tool_state in ['1', '2'] and workorder.state == 'ready':
|
if workorder.production_id.tool_state in ['1', '2'] and workorder.state == 'ready':
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
continue
|
continue
|
||||||
|
if (workorder.production_id.tool_state in ['1', '2']
|
||||||
|
and not workorder.production_id.workorder_ids.filtered(lambda a: a.sequence == 0)
|
||||||
|
and workorder.production_id.programming_state == '编程中' and workorder.name == '装夹预调'):
|
||||||
|
if workorder.state == 'pending' and workorder == self.search(
|
||||||
|
[('production_id', '=', workorder.production_id.id),
|
||||||
|
('routing_type', '=', '装夹预调'),
|
||||||
|
('state', 'not in', ['rework', 'done', 'cancel'])],
|
||||||
|
limit=1,
|
||||||
|
order="sequence"):
|
||||||
|
workorder.state = 'waiting'
|
||||||
|
continue
|
||||||
|
|
||||||
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
# elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'cancel', 'progress',
|
||||||
# 'rework']:
|
# 'rework']:
|
||||||
|
|||||||
Reference in New Issue
Block a user