工单返工优化待排序(工单就绪状态还没完成)
This commit is contained in:
@@ -164,14 +164,20 @@ class MrpProduction(models.Model):
|
||||
|
||||
#工单排序
|
||||
def _reset_work_order_sequence1(self, k):
|
||||
sequen = 0
|
||||
for rec in self:
|
||||
current_sequence = 1
|
||||
current_sequence = 10
|
||||
for work in rec.workorder_ids:
|
||||
work.sequence = current_sequence
|
||||
current_sequence += 1
|
||||
sfa = rec
|
||||
for a in sfa:
|
||||
print(a)
|
||||
current_sequence += 10
|
||||
if work.name == '后置三元质量检测' and work.processing_panel == k:
|
||||
sequen = work.sequence
|
||||
|
||||
for work in rec.workorder_ids:
|
||||
if work.name == '后置三元质量检测(返工)' and work.processing_panel == k:
|
||||
work.sequence = sequen + 2
|
||||
if work.name == 'CNC加工(返工)' and work.processing_panel == k:
|
||||
work.sequence = sequen + 1
|
||||
|
||||
#在制造订单上新增工单
|
||||
def _create_workorder1(self, k):
|
||||
@@ -211,6 +217,7 @@ class MrpProduction(models.Model):
|
||||
order='sequence asc'
|
||||
)
|
||||
i += 1
|
||||
|
||||
for route in routingworkcenter:
|
||||
|
||||
if route.routing_type == '后置三元质量检测':
|
||||
@@ -222,8 +229,10 @@ class MrpProduction(models.Model):
|
||||
self.env['mrp.workorder'].json_workorder_str1(k, production, route))
|
||||
|
||||
production.workorder_ids = workorders_values
|
||||
for workorder in production.workorder_ids:
|
||||
workorder.duration_expected = workorder._get_duration_expected()
|
||||
workorder = self.env['mrp.workorder'].browse(production.workorder_ids.ids)
|
||||
print(workorder)
|
||||
# for item in workorder:
|
||||
# workorder.duration_expected = workorder._get_duration_expected()
|
||||
|
||||
def _create_workorder2(self, k):
|
||||
res = self._create_workorder1(k)
|
||||
|
||||
Reference in New Issue
Block a user