mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] WuBook issue with limit for min_price and max_price
This commit is contained in:
@@ -137,8 +137,8 @@ class WuBookAdapter(AbstractComponent):
|
|||||||
descriptions,
|
descriptions,
|
||||||
boards,
|
boards,
|
||||||
int(rtype),
|
int(rtype),
|
||||||
# min_price, # Issue limit for min_price and max_price is they have to be higher than 5
|
min_price, # Issue limit for min_price and max_price is they have to be higher than 5
|
||||||
# max_price,
|
max_price,
|
||||||
)
|
)
|
||||||
if rcode != 0:
|
if rcode != 0:
|
||||||
raise ChannelConnectorError(_("Can't create room in WuBook"), {
|
raise ChannelConnectorError(_("Can't create room in WuBook"), {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import api, models, fields, _
|
||||||
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.addons.component.core import Component
|
from odoo.addons.component.core import Component
|
||||||
|
|
||||||
|
|
||||||
class HotelRoomTypeAdapter(Component):
|
class HotelRoomTypeAdapter(Component):
|
||||||
_name = 'channel.hotel.room.type.adapter'
|
_name = 'channel.hotel.room.type.adapter'
|
||||||
_inherit = 'wubook.adapter'
|
_inherit = 'wubook.adapter'
|
||||||
@@ -26,3 +27,14 @@ class HotelRoomTypeAdapter(Component):
|
|||||||
|
|
||||||
def delete_room(self, channel_room_id):
|
def delete_room(self, channel_room_id):
|
||||||
return super(HotelRoomTypeAdapter, self).delete_room(channel_room_id)
|
return super(HotelRoomTypeAdapter, self).delete_room(channel_room_id)
|
||||||
|
|
||||||
|
|
||||||
|
class ChannelHotelRoomType(models.Model):
|
||||||
|
_inherit = 'hotel.room.type'
|
||||||
|
|
||||||
|
@api.constrains('min_price', 'max_price')
|
||||||
|
def _check_min_max_price(self):
|
||||||
|
for record in self:
|
||||||
|
if record.min_price < 5 or record.max_price < 5:
|
||||||
|
msg = _("The channel manager limits the minimum value of min price and max price to 5.")
|
||||||
|
raise ValidationError(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user