Commit f18812ae by 夏超

[fix] 修改问题

parent 1f685a74
...@@ -67,6 +67,7 @@ class InheritProductionTask(models.Model): ...@@ -67,6 +67,7 @@ class InheritProductionTask(models.Model):
work_order_data = self._get_new_work_order_data(routing_line, product, plan_qty, task_type) work_order_data = self._get_new_work_order_data(routing_line, product, plan_qty, task_type)
work_order_data['planned_start_time'] = date work_order_data['planned_start_time'] = date
work_order_data['plan_date'] = date work_order_data['plan_date'] = date
work_order_data['priority'] = self.priority
work_orders.append( work_orders.append(
(0, 0, work_order_data)) (0, 0, work_order_data))
else: else:
...@@ -86,6 +87,7 @@ class InheritProductionTask(models.Model): ...@@ -86,6 +87,7 @@ class InheritProductionTask(models.Model):
work_order_data = self._get_new_work_order_data(routing_line, product, plan_qty, task_type) work_order_data = self._get_new_work_order_data(routing_line, product, plan_qty, task_type)
work_order_data['planned_start_time'] = date work_order_data['planned_start_time'] = date
work_order_data['plan_date'] = date work_order_data['plan_date'] = date
work_order_data['priority'] = self.priority
work_orders.append( work_orders.append(
(0, 0, work_order_data)) (0, 0, work_order_data))
return work_orders return work_orders
...@@ -138,7 +140,7 @@ class InheritProductionTask(models.Model): ...@@ -138,7 +140,7 @@ class InheritProductionTask(models.Model):
def craft_design(self): def craft_design(self):
if not self.routing_id: if not self.routing_id:
routing_id = self.env["roke.routing"].create({ routing_id = self.env["roke.routing"].create({
"name": self.product_id.name or "", "name": f"{self.product_id.name}({self.code})" or "",
"routing_task_id": self.id "routing_task_id": self.id
}) })
self.write({ self.write({
...@@ -150,6 +152,7 @@ class InheritProductionTask(models.Model): ...@@ -150,6 +152,7 @@ class InheritProductionTask(models.Model):
elif not self.routing_id.routing_task_id or self.routing_id.routing_task_id.id != self.id: elif not self.routing_id.routing_task_id or self.routing_id.routing_task_id.id != self.id:
routing_id = self.routing_id.copy() routing_id = self.routing_id.copy()
routing_id.update({ routing_id.update({
"name": f"{routing_id.name}({self.code})",
"routing_task_id": self.id "routing_task_id": self.id
}) })
self.write({"routing_id": routing_id.id}) self.write({"routing_id": routing_id.id})
...@@ -159,7 +162,7 @@ class InheritProductionTask(models.Model): ...@@ -159,7 +162,7 @@ class InheritProductionTask(models.Model):
else: else:
routing_id = self.routing_id routing_id = self.routing_id
return { return {
"name": "工艺设计", "name": f"工艺设计({self.code})",
"type": "ir.actions.client", "type": "ir.actions.client",
"tag": "jzjx_project.roke_craft_design", "tag": "jzjx_project.roke_craft_design",
"target": "current", "target": "current",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment