From 6d5252544148a97b8e9e38bc01972861b1024263 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 Aug 2022 15:31:13 +0200 Subject: [PATCH 1/2] demandes magali 26/08 --- models/booking_event_registration.py | 10 +++++++++- models/product.py | 2 +- views/booking_event_registration.xml | 13 ++++++++++++- views/product.xml | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/models/booking_event_registration.py b/models/booking_event_registration.py index f673fc2..ff5c3e5 100644 --- a/models/booking_event_registration.py +++ b/models/booking_event_registration.py @@ -99,7 +99,15 @@ class EventRegistration(models.Model): payment_status=fields.Selection(string='payment status',selection=[('paid','Paid'),('not paid','Not paid'),('down payment not paid','down payment not paid'),('down payment paid','down payment paid')],compute='_compute_payment_status',translate=True) to_be_paid_amount=fields.Monetary('to be paid amount',compute='_compute_to_be_paid_amount',currency_field='currency_id') payment_adjustement=fields.Monetary('payment adjustement',currency_field='currency_id') - + individual_room=fields.Boolean('Individual room',compute='compute_individual_room') + + def compute_individual_room(self): + for rec in self: + prd=self.env['product.product'].search([('individual_room','=',True)]) + rec.individual_room=False + for opt in rec.option_ids: + if prd.id==opt.booking_option_id.id : rec.individual_room=True + def _compute_to_be_paid_amount(self): for rec in self: rec.to_be_paid_amount=0 diff --git a/models/product.py b/models/product.py index 87daa5c..4275a22 100644 --- a/models/product.py +++ b/models/product.py @@ -13,4 +13,4 @@ class KalachakraProductTemplate(models.Model): booking_product = fields.Boolean(string="booking product", tracking=True) booking_option_product = fields.Boolean(string="booking option product", tracking=True) price_per=fields.Selection(string="Price per",selection=[('stay','Stay'),('night', 'Night'), ('day', 'Day')], default='stay', tracking=True) - \ No newline at end of file + individual_room=fields.Boolean(string="individual room", tracking=True) \ No newline at end of file diff --git a/views/booking_event_registration.xml b/views/booking_event_registration.xml index 176f561..46608d5 100644 --- a/views/booking_event_registration.xml +++ b/views/booking_event_registration.xml @@ -239,10 +239,21 @@ - + + + + + + + + + + + + diff --git a/views/product.xml b/views/product.xml index 000f39d..94c96ba 100644 --- a/views/product.xml +++ b/views/product.xml @@ -14,6 +14,7 @@ + From d23ead9050ddbb7188f781b914994d9b2c7f39a0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 26 Aug 2022 21:12:27 +0200 Subject: [PATCH 2/2] column event --- __manifest__.py | 2 ++ static/src/css/kalachakra_backoffice.css | 4 ++++ views/asset.xml | 7 +++++++ views/event.xml | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 static/src/css/kalachakra_backoffice.css create mode 100644 views/asset.xml diff --git a/__manifest__.py b/__manifest__.py index ecbe989..42d2507 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -65,6 +65,8 @@ 'views/auth_signup_login_templates.xml', 'views/website_templates.xml', 'views/media.xml', + 'views/asset.xml', + #'views/payment_views.xml' diff --git a/static/src/css/kalachakra_backoffice.css b/static/src/css/kalachakra_backoffice.css new file mode 100644 index 0000000..f460f1d --- /dev/null +++ b/static/src/css/kalachakra_backoffice.css @@ -0,0 +1,4 @@ +.tree_evt_name_column { + width: 400px !important; + max-width: 400px !important; + } \ No newline at end of file diff --git a/views/asset.xml b/views/asset.xml new file mode 100644 index 0000000..8ae05f8 --- /dev/null +++ b/views/asset.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/views/event.xml b/views/event.xml index 1648a88..0c00ec2 100644 --- a/views/event.xml +++ b/views/event.xml @@ -24,7 +24,7 @@ - 300px + tree_evt_name_column