mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] Security Rules
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user