From c44ef78f6ae92a8a1d972ef899c4523e90f0637e Mon Sep 17 00:00:00 2001 From: Unai Beristain Date: Thu, 26 Dec 2024 14:53:58 +0100 Subject: [PATCH] [IMP] mrp_repair_type: Change column name to avoid conflict --- mrp_repair_type/models/mrp_repair.py | 2 +- repair_order_type/models/repair_order.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_repair_type/models/mrp_repair.py b/mrp_repair_type/models/mrp_repair.py index 522607c..8c36dba 100644 --- a/mrp_repair_type/models/mrp_repair.py +++ b/mrp_repair_type/models/mrp_repair.py @@ -13,6 +13,6 @@ class RepairOrderType(models.Model): class RepairOrder(models.Model): _inherit = "repair.order" - repair_type_id = fields.Many2one( + repair_order_type_id = fields.Many2one( comodel_name="repair.order.type", string="Repair order type" ) diff --git a/repair_order_type/models/repair_order.py b/repair_order_type/models/repair_order.py index 6605898..6677811 100644 --- a/repair_order_type/models/repair_order.py +++ b/repair_order_type/models/repair_order.py @@ -28,7 +28,7 @@ def onchange_location_id(self): def create(self, vals): if vals.get("name", "/") == "/" and vals.get("type_id"): repair_type = self.env["repair.order.type"].browse(vals["type_id"]) - if repair_type.sequence_id: + if hasattr(repair_type, "sequence_id") and repair_type.sequence_id: vals["name"] = repair_type.sequence_id.next_by_id() return super().create(vals)