Commit 77a9ae74 by 夏超

[fix] 工艺设计

parent 5d9b78a4
...@@ -131,7 +131,7 @@ class InheritProductionTask(models.Model): ...@@ -131,7 +131,7 @@ class InheritProductionTask(models.Model):
raise ValidationError("该任务已报工,无法生成新的工艺设计。") raise ValidationError("该任务已报工,无法生成新的工艺设计。")
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": f"{self.product_id.name}({self.code})" or "" "name": f"{self.product_id.name}" or ""
}) })
self.write({"routing_id": routing_id.id}) self.write({"routing_id": routing_id.id})
self.product_id.write({"routing_id": routing_id.id}) self.product_id.write({"routing_id": routing_id.id})
...@@ -141,7 +141,7 @@ class InheritProductionTask(models.Model): ...@@ -141,7 +141,7 @@ class InheritProductionTask(models.Model):
else: else:
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})" "name": f"{routing_id.name}"
}) })
self.write({"routing_id": routing_id.id}) self.write({"routing_id": routing_id.id})
self.product_id.write({"routing_id": routing_id.id}) self.product_id.write({"routing_id": routing_id.id})
......
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