1、优化工单状态
This commit is contained in:
@@ -687,6 +687,9 @@ class MrpProduction(models.Model):
|
|||||||
for work_id in work_ids:
|
for work_id in work_ids:
|
||||||
if panel_sequence_list.get(work_id.name):
|
if panel_sequence_list.get(work_id.name):
|
||||||
work_id.sequence = panel_sequence_list[work_id.name]
|
work_id.sequence = panel_sequence_list[work_id.name]
|
||||||
|
if rec.tool_state in ['1', '2']:
|
||||||
|
rec.workorder_ids.filtered(
|
||||||
|
lambda a: a.routing_type == '装夹预调' and a.state in 'ready').compute_state()
|
||||||
|
|
||||||
# 创建工单并进行排序
|
# 创建工单并进行排序
|
||||||
def _create_workorder(self, item):
|
def _create_workorder(self, item):
|
||||||
|
|||||||
@@ -988,6 +988,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready':
|
# elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready':
|
||||||
# workorder.state = 'waiting'
|
# workorder.state = 'waiting'
|
||||||
|
|
||||||
|
def compute_state(self):
|
||||||
|
self._compute_state()
|
||||||
|
|
||||||
# 重写工单开始按钮方法
|
# 重写工单开始按钮方法
|
||||||
def button_start(self):
|
def button_start(self):
|
||||||
if self.routing_type == '装夹预调':
|
if self.routing_type == '装夹预调':
|
||||||
|
|||||||
Reference in New Issue
Block a user