工单展示组件

This commit is contained in:
gqh
2023-03-21 13:58:46 +08:00
parent 00fdf38cc7
commit 9807f515e9
5 changed files with 12 additions and 9 deletions

View File

@@ -247,8 +247,8 @@ class MrpProduction(models.Model):
current_sequence += 1
if work.name == '获取CNC加工程序':
work.button_start()
#work.button_finish()
work.fetchCNC()
work.button_finish()
#work.fetchCNC()
#创建工单并进行排序
def _create_workorder(self):

View File

@@ -153,7 +153,8 @@ class ResMrpWorkOrder(models.Model):
'date_planned_start': False,
'date_planned_finished': False,
'duration_expected': 60,
'duration': 0
'duration': 0,
}]
return workorders_values_str
@@ -389,7 +390,8 @@ class ResMrpWorkOrder(models.Model):
'date_planned_start': False,
'date_planned_finished': False,
'duration_expected': 60,
'duration': 0
'duration': 0,
}]
return workorders_values_str
@@ -399,6 +401,7 @@ class ResMrpWorkOrder(models.Model):
if self.routing_type == '装夹':
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress':
self.move_raw_ids = self.production_id.move_raw_ids
self.ensure_one()
if any(not time.date_end for time in self.time_ids.filtered(lambda t: t.user_id.id == self.env.user.id)):
return True