diff --git a/hotel/models/hotel_room_type.py b/hotel/models/hotel_room_type.py index aade9f8bf..0d21fd957 100644 --- a/hotel/models/hotel_room_type.py +++ b/hotel/models/hotel_room_type.py @@ -41,13 +41,11 @@ class HotelRoomType(models.Model): _order = "sequence, code_type, name" - _sql_constraints = [('code_type_unique', 'unique(code_type)', - 'code must be unique!')] # total number of rooms in this type total_rooms_count = fields.Integer(compute='_compute_total_rooms', store=True) - _sql_constraints = [ - ('code_unique', 'unique(code_type)', 'Room Type Code must be unique!')] + _sql_constraints = [('code_unique', 'unique(code_type)', + 'Room Type Code must be unique!')] @api.depends('room_ids') def _compute_total_rooms(self):