[WIP] Minor cleanup

This commit is contained in:
Pablo Quesada Barriuso
2018-07-27 19:36:55 +02:00
parent a03920f93b
commit 5bd6c1ddbf
2 changed files with 0 additions and 20 deletions

View File

@@ -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 ?