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)