mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] Use default avail on call center wizard
This commit is contained in:
@@ -328,6 +328,8 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
record.can_confirm = record.max_rooms > 0 and record.min_stay <= date_diff
|
record.can_confirm = record.max_rooms > 0 and record.min_stay <= date_diff
|
||||||
|
|
||||||
def _compute_max(self):
|
def _compute_max(self):
|
||||||
|
# REVIEW: This methid has a incorrect dependencies with hotel_channel_conector
|
||||||
|
# because use avail model defined on this module
|
||||||
for res in self:
|
for res in self:
|
||||||
user = self.env['res.users'].browse(self.env.uid)
|
user = self.env['res.users'].browse(self.env.uid)
|
||||||
date_start = fields.Date.from_string(res.checkin)
|
date_start = fields.Date.from_string(res.checkin)
|
||||||
@@ -367,6 +369,9 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
if restriction:
|
if restriction:
|
||||||
if restriction.channel_bind_ids[0]:
|
if restriction.channel_bind_ids[0]:
|
||||||
max_avail = restriction.channel_bind_ids[0].channel_avail
|
max_avail = restriction.channel_bind_ids[0].channel_avail
|
||||||
|
elif res.room_type_id.channel_bind_ids:
|
||||||
|
if res.room_type_id.channel_bind_ids[0]:
|
||||||
|
max_avail = res.room_type_id.channel_bind_ids[0].default_max_avail
|
||||||
if max_avail < avail:
|
if max_avail < avail:
|
||||||
avail = min(max_avail, real_max)
|
avail = min(max_avail, real_max)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user