From f60dec1f2446769843e2b3cac40c21f1e6e83900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Fri, 20 Sep 2019 11:59:08 +0200 Subject: [PATCH] [FIX] Allow change price on rooms without binding --- .../models/product_pricelist_item/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotel_channel_connector/models/product_pricelist_item/common.py b/hotel_channel_connector/models/product_pricelist_item/common.py index 27741959d..8136414df 100644 --- a/hotel_channel_connector/models/product_pricelist_item/common.py +++ b/hotel_channel_connector/models/product_pricelist_item/common.py @@ -55,8 +55,8 @@ class ProductPricelistItem(models.Model): for record in self: channel_room_type = self.env['channel.hotel.room.type'].search( [('product_tmpl_id', '=', record.product_tmpl_id.id)]) - if record.fixed_price < channel_room_type.min_price or \ - record.fixed_price > channel_room_type.max_price: + if channel_room_type and (record.fixed_price < channel_room_type.min_price or \ + record.fixed_price > channel_room_type.max_price): msg = _("The room type '%s' limits the price between '%s' and '%s'.") \ % (record.name, channel_room_type.min_price, channel_room_type.max_price) raise ValidationError(msg)