mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] Minor cleanup
This commit is contained in:
@@ -49,8 +49,6 @@ class HotelRoomType(models.Model):
|
||||
'code must be unique!')]
|
||||
# total number of rooms in this type
|
||||
total_rooms_count = fields.Integer(compute='_compute_total_rooms')
|
||||
# FIXING rename to default rooms ?
|
||||
max_real_rooms = fields.Integer('Default Max Room Allowed')
|
||||
|
||||
@api.depends('room_ids')
|
||||
def _compute_total_rooms(self):
|
||||
@@ -63,15 +61,6 @@ class HotelRoomType(models.Model):
|
||||
# FIXME Using a Many2one relationship duplicated should not been possible
|
||||
pass
|
||||
|
||||
@api.constrains('max_real_rooms', 'room_ids')
|
||||
def _check_max_rooms(self):
|
||||
warning_msg = ""
|
||||
# for r in self:
|
||||
if self.max_real_rooms > self.total_rooms_count:
|
||||
warning_msg += _('The Maxime rooms allowed can not be greate \
|
||||
than total rooms count')
|
||||
raise models.ValidationError(warning_msg)
|
||||
|
||||
@api.multi
|
||||
def get_capacity(self):
|
||||
# WARNING use selg.capacity directly ?
|
||||
|
||||
Reference in New Issue
Block a user