diff --git a/hotel_channel_connector/__manifest__.py b/hotel_channel_connector/__manifest__.py index b696b058b..9fbaf81c3 100644 --- a/hotel_channel_connector/__manifest__.py +++ b/hotel_channel_connector/__manifest__.py @@ -38,6 +38,7 @@ 'views/channel_product_pricelist_views.xml', 'views/channel_product_pricelist_item_views.xml', 'views/channel_connector_backend_views.xml', + 'wizard/inherited_massive_changes.xml', 'data/menus.xml', 'data/sequences.xml', #'security/ir.model.access.csv', diff --git a/hotel_channel_connector/models/hotel_room_type_availability/common.py b/hotel_channel_connector/models/hotel_room_type_availability/common.py index c2dc85b3c..e98b765ed 100644 --- a/hotel_channel_connector/models/hotel_room_type_availability/common.py +++ b/hotel_channel_connector/models/hotel_room_type_availability/common.py @@ -35,7 +35,7 @@ class ChannelHotelRoomTypeAvailability(models.Model): old_name='wpushed') @api.constrains('channel_max_avail') - def _check_wmax_avail(self): + def _check_channel_max_avail(self): for record in self: if record.channel_max_avail > record.odoo_id.room_type_id.total_rooms_count: raise ValidationError(_("max avail for channel can't be high \ diff --git a/hotel_channel_connector/wizard/inherited_massive_changes.py b/hotel_channel_connector/wizard/inherited_massive_changes.py index 200de2537..99c4abb88 100644 --- a/hotel_channel_connector/wizard/inherited_massive_changes.py +++ b/hotel_channel_connector/wizard/inherited_massive_changes.py @@ -2,18 +2,22 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from datetime import datetime, timedelta from odoo.exceptions import ValidationError -from odoo import models, api +from odoo import fields, models, api class MassiveChangesWizard(models.TransientModel): _inherit = 'hotel.wizard.massive.changes' + change_no_ota = fields.Boolean(default=False) + no_ota = fields.Boolean('No OTA', default=False) + @api.model def _get_availability_values(self, ndate, room_type, record): vals = super(MassiveChangesWizard, self)._get_availability_values( ndate, room_type, record) vals.update({ - 'wmax_avail': vals['avail'] + 'channel_max_avail': vals['avail'], + 'no_ota': record.no_ota, }) return vals diff --git a/hotel_channel_connector/wizard/inherited_massive_changes.xml b/hotel_channel_connector/wizard/inherited_massive_changes.xml new file mode 100644 index 000000000..3a1f4fe9c --- /dev/null +++ b/hotel_channel_connector/wizard/inherited_massive_changes.xml @@ -0,0 +1,17 @@ + + + + + hotel.wizard.massive.changes + + + + + No OTA + + + + + + +