Commit f18812ae by 夏超

[fix] 修改问题

parent 1f685a74
......@@ -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['planned_start_time'] = date
work_order_data['plan_date'] = date
work_order_data['priority'] = self.priority
work_orders.append(
(0, 0, work_order_data))
else:
......@@ -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['planned_start_time'] = date
work_order_data['plan_date'] = date
work_order_data['priority'] = self.priority
work_orders.append(
(0, 0, work_order_data))
return work_orders
......@@ -138,7 +140,7 @@ class InheritProductionTask(models.Model):
def craft_design(self):
if not self.routing_id:
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
})
self.write({
......@@ -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:
routing_id = self.routing_id.copy()
routing_id.update({
"name": f"{routing_id.name}({self.code})",
"routing_task_id": self.id
})
self.write({"routing_id": routing_id.id})
......@@ -159,7 +162,7 @@ class InheritProductionTask(models.Model):
else:
routing_id = self.routing_id
return {
"name": "工艺设计",
"name": f"工艺设计({self.code})",
"type": "ir.actions.client",
"tag": "jzjx_project.roke_craft_design",
"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