diff --git a/booking_engine/__manifest__.py b/booking_engine/__manifest__.py index eacdefa6ec..78c5c184d7 100644 --- a/booking_engine/__manifest__.py +++ b/booking_engine/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Booking Engine', - 'version': '1.0', + 'version': '1.1', 'category': 'Hidden/Tools', 'author': 'Odoo S.A.', 'depends': [ @@ -15,6 +15,8 @@ ], 'data': [ 'data/res_config_settings.xml', + 'data/ir_model.xml', + 'data/ir_model_access.xml', 'data/ir_model_fields.xml', 'data/account_tax.xml', 'data/product_template.xml', diff --git a/booking_engine/data/base_automation.xml b/booking_engine/data/base_automation.xml index dd888aa686..02d3124af2 100644 --- a/booking_engine/data/base_automation.xml +++ b/booking_engine/data/base_automation.xml @@ -1,17 +1,8 @@ - - - - on_create_or_write - On SO line edit, add/edit city tax - - [('x_picked_up', '=', False)] - [('x_picked_up', '=', True)] - - + on_create_or_write Fix Slot Times diff --git a/booking_engine/data/ir_actions_server.xml b/booking_engine/data/ir_actions_server.xml index 20bc223681..5fc926cf15 100644 --- a/booking_engine/data/ir_actions_server.xml +++ b/booking_engine/data/ir_actions_server.xml @@ -1,59 +1,52 @@ - + Add/Update City Tax - - base_automation + code - 0: stay_taxes += so_line.x_nights - if so_line.product_id.x_is_stay_tax: stay_tax_line = so_line - if stay_taxes > 0: - if stay_tax_line: stay_tax_line['product_uom_qty'] = stay_taxes - else: # Add stay tax product - product = env['product.product'].search([('x_is_stay_tax', '=', True)], limit=1) - env['sale.order.line'].create({'order_id': record.id, 'product_id': product.id, 'product_uom_qty': stay_taxes}) + 0: + product = env['product.product'].search([('x_is_stay_tax', '=', True)], limit=1) + env['sale.order.line'].create({'order_id': record.x_sale_order_id.id, 'product_id': product.id, 'product_uom_qty': record.x_total, 'qty_delivered': record.x_total}) ]]> - - Trigger SO Update from Slot - - base_automation + + Open City Tax + code 0: - stay_taxes += so_line.x_nights - if so_line.product_id.x_is_stay_tax: - stay_tax_line = so_line - if stay_taxes > 0: - if stay_tax_line: - stay_tax_line['product_uom_qty'] = stay_taxes +record.order_line.planning_slot_ids['x_guests'] = len(record.x_guests) // (len(record.order_line.planning_slot_ids) or 1) or 1 +action = { + 'type': 'ir.actions.act_window', + 'name': 'City tax', + 'res_model': 'x_city_tax', + 'view_mode': 'form', + 'target': 'new', + 'context': {'search_default_x_sale_order_id': record.id, 'default_x_sale_order_id': record.id}, + 'domain': [('x_sale_order_id', '=', record.id)], +} ]]> - - - - base_automation - code - Fix Slot Times - + + + base_automation + code + Fix Slot Times + + + + Apply Rental Checkout + + code + diff --git a/booking_engine/data/ir_model.xml b/booking_engine/data/ir_model.xml new file mode 100644 index 0000000000..b75198f17f --- /dev/null +++ b/booking_engine/data/ir_model.xml @@ -0,0 +1,8 @@ + + + + City tax + x_city_tax + + + diff --git a/booking_engine/data/ir_model_access.xml b/booking_engine/data/ir_model_access.xml new file mode 100644 index 0000000000..29ddc61237 --- /dev/null +++ b/booking_engine/data/ir_model_access.xml @@ -0,0 +1,12 @@ + + + + + + x_city_tax_user_access + + + + + + diff --git a/booking_engine/data/ir_model_fields.xml b/booking_engine/data/ir_model_fields.xml index 8ea072c2b6..adee2cd1d2 100644 --- a/booking_engine/data/ir_model_fields.xml +++ b/booking_engine/data/ir_model_fields.xml @@ -84,8 +84,7 @@ record['x_identity_check'] = 'na' elif record.x_nationality and record.x_document_type and record.x_document_number: record['x_identity_check'] = 'ok' - else: - record['x_identity_check'] = 'invalid' + else: record['x_identity_check'] = 'invalid' ]]> @@ -115,8 +114,8 @@ Order Involves Room x_order_involves_room - order_line @@ -135,8 +134,8 @@ order_line.qty_delivered - integer Guests count @@ -162,9 +161,8 @@ res.partner x_ongoing_booking.partner_id - @@ -176,4 +174,63 @@ x_ongoing_bookings + + integer + Nights + + start_datetime, end_datetime + x_nights + + + + integer + Guests + + x_guests + + + integer + City tax count + + x_nights, x_guests + x_city_tax + + + + many2one + Sale order + + sale.order + x_sale_order_id + + + + many2many + Slots + + planning.slot + x_sale_order_id.order_line.planning_slot_ids + x_slot_ids + + + + + integer + Total + + planning_total + x_total + x_slot_ids, x_slot_ids.x_city_tax + + + + diff --git a/booking_engine/data/ir_ui_view.xml b/booking_engine/data/ir_ui_view.xml index b054a45c76..66bacbb607 100644 --- a/booking_engine/data/ir_ui_view.xml +++ b/booking_engine/data/ir_ui_view.xml @@ -1,5 +1,47 @@ + + +
+ + + + + + + + + + + + +
+
+
+
+ primary + x_city_tax + x_city_tax.form.booking_engine + 200 + form + +
+ + + +