diff --git a/hotel/i18n/es.po b/hotel/i18n/es.po index 8349a9828..92909bf62 100644 --- a/hotel/i18n/es.po +++ b/hotel/i18n/es.po @@ -8508,11 +8508,6 @@ msgstr "Virtual Plan" msgid "Volume" msgstr "Volumen" -#. module: hotel -#: model:ir.model.fields,field_description:hotel.field_hotel_room_type_warehouse_id -msgid "Warehouse" -msgstr "Almacén" - #. module: hotel #: code:addons/hotel/models/inherited_account_payment.py:109 #, python-format diff --git a/hotel/models/hotel_board_service_line.py b/hotel/models/hotel_board_service_line.py index 8475f57cc..0199bd5aa 100644 --- a/hotel/models/hotel_board_service_line.py +++ b/hotel/models/hotel_board_service_line.py @@ -12,18 +12,20 @@ class HotelBoardServiceLine(models.Model): def _get_default_price(self): if self.product_id: return self.product_id.list_price - + hotel_board_service_id = fields.Many2one( - 'hotel.board.service', 'Board Service', ondelete='cascade', required=True) + 'hotel.board.service', + 'Board Service', + ondelete='cascade', + required=True) product_id = fields.Many2one( 'product.product', 'Product', required=True) - amount = fields.Float('Amount', - digits=dp.get_precision('Product Price'), default=_get_default_price) + amount = fields.Float( + 'Amount', + digits=dp.get_precision('Product Price'), + default=_get_default_price) @api.onchange('product_id') def onchange_product_id(self): if self.product_id: self.update({'amount': self.product_id.list_price}) - - - diff --git a/hotel/models/hotel_service.py b/hotel/models/hotel_service.py index 273b636ab..981e9f106 100644 --- a/hotel/models/hotel_service.py +++ b/hotel/models/hotel_service.py @@ -169,11 +169,17 @@ class HotelService(models.Model): if self.compute_lines_out_vals(vals): reservation = self.env['hotel.reservation'].browse(vals['ser_room_line']) product = self.env['product.product'].browse(vals['product_id']) - checkin_dt = fields.Date.from_string(reservation.real_checkin) - checkout_dt = fields.Date.from_string(reservation.real_checkout) + if reservation.splitted: + checkin = reservation.real_checkin + checkout = reservation.real_checkout + else: + checkin = reservation.checkin + checkout = reservation.checkout + checkin_dt = fields.Date.from_string(checkin) + checkout_dt = fields.Date.from_string(checkout) nights = abs((checkout_dt - checkin_dt).days) vals.update(self.prepare_service_lines( - dfrom=reservation.real_checkin, + dfrom=checkin, days=nights, per_person=product.per_person, persons=reservation.adults, @@ -190,18 +196,24 @@ class HotelService(models.Model): product = self.env['product.product'].browse(vals.get('product_id')) if not product.per_day: vals.update({ - 'service_line_ids' : [(5, 0, 0)] + 'service_line_ids': [(5, 0, 0)] }) else: for record in self: reservations = self.env['hotel.reservation'] reservation = reservations.browse(vals['ser_room_line']) \ if 'ser_room_line' in vals else record.ser_room_line - checkin_dt = fields.Date.from_string(reservation.real_checkin) - checkout_dt = fields.Date.from_string(reservation.real_checkout) + if reservation.splitted: + checkin = reservation.real_checkin + checkout = reservation.real_checkout + else: + checkin = reservation.checkin + checkout = reservation.checkout + checkin_dt = fields.Date.from_string(checkin) + checkout_dt = fields.Date.from_string(checkout) nights = abs((checkout_dt - checkin_dt).days) record.update(record.prepare_service_lines( - dfrom=reservation.real_checkin, + dfrom=checkin, days=nights, per_person=product.per_person, persons=reservation.adults, @@ -277,11 +289,17 @@ class HotelService(models.Model): if record.per_day and record.ser_room_line: product = record.product_id reservation = record.ser_room_line - checkin_dt = fields.Date.from_string(reservation.real_checkin) - checkout_dt = fields.Date.from_string(reservation.real_checkout) + if reservation.splitted: + checkin = reservation.real_checkin + checkout = reservation.real_checkout + else: + checkin = reservation.checkin + checkout = reservation.checkout + checkin_dt = fields.Date.from_string(checkin) + checkout_dt = fields.Date.from_string(checkout) nights = abs((checkout_dt - checkin_dt).days) vals.update(record.prepare_service_lines( - dfrom=reservation.real_checkin, + dfrom=checkin, days=nights, per_person=product.per_person, persons=reservation.adults, diff --git a/hotel/security/ir.model.access.csv b/hotel/security/ir.model.access.csv index 5f26aedcc..3b8db2475 100644 --- a/hotel/security/ir.model.access.csv +++ b/hotel/security/ir.model.access.csv @@ -18,6 +18,7 @@ user_access_hotel_room_type,user_access_hotel_room_type,model_hotel_room_type,ho user_access_hotel_board_service_room_type,user_access_hotel_board_service_room_type,model_hotel_board_service_room_type,hotel.group_hotel_user,1,0,0,0 user_access_hotel_board_service_room_type_line,user_access_hotel_board_service_room_type_line,model_hotel_board_service_room_type_line,hotel.group_hotel_user,1,0,0,0 user_access_hotel_board_service_line,user_access_hotel_board_service_line,model_hotel_board_service_line,hotel.group_hotel_user,1,0,0,0 +user_access_account_partial_reconcile,user_accessaccount_partial_reconcile,account.model_account_partial_reconcile,hotel.group_hotel_user,1,1,1,1 manager_access_hotel_floor,manager_access_hotel_floor,model_hotel_floor,hotel.group_hotel_manager,1,1,1,1 manager_access_hotel_amenity,manager_access_hotel_amenity,model_hotel_amenity,hotel.group_hotel_manager,1,1,1,1 manager_access_hotel_amenity_type,manager_access_hotel_amenity_type,model_hotel_amenity_type,hotel.group_hotel_manager,1,1,1,1 diff --git a/hotel_l10n_es/security/ir.model.access.csv b/hotel_l10n_es/security/ir.model.access.csv index 97dd8b917..7a6b2cc1c 100644 --- a/hotel_l10n_es/security/ir.model.access.csv +++ b/hotel_l10n_es/security/ir.model.access.csv @@ -1 +1,7 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_hotel_l10n_es.model_category_user","hotell10n.category_ine.user","hotel_l10n_es.model_tourism_category","hotel.group_hotel_user",1,0,0,0 +"access_hotel_l10n_es.code_ine_user","hotell10n.code_ine.user","hotel_l10n_es.model_code_ine","hotel.group_hotel_user",1,0,0,0 +"access_hotel_l10n_es.model_category_manager","hotell10n.category_ine.manager","hotel_l10n_es.model_tourism_category","hotel.group_hotel_manager",1,1,1,1 +"access_hotel_l10n_es.code_ine_manager","hotell10n.code_ine.manager","hotel_l10n_es.model_code_ine","hotel.group_hotel_manager",1,1,1,1 +"access_hotel_l10n_es.model_category_call","hotell10n.category_ine.call","hotel_l10n_es.model_tourism_category","hotel.group_hotel_call",1,0,0,0 +"access_hotel_l10n_es.code_ine_call","hotell10n.code_ine.call","hotel_l10n_es.model_code_ine","hotel.group_hotel_call",1,0,0,0