diff --git a/models/booking_event.py b/models/booking_event.py index bd873a7..71b4833 100644 --- a/models/booking_event.py +++ b/models/booking_event.py @@ -21,7 +21,7 @@ class EventType(models.Model): class EventBookingOptions(models.Model): _name='booking.option' _description='booking options for events' - booking_option_id=fields.Many2one('product.product',string='booking options',domain="[('booking_option_product','=','True')]") + booking_option_id=fields.Many2one('product.product',string='booking options',domain="['|',('booking_option_product','=','True'),('booking_option_product_backoffice','=','True')]") name=fields.Char(related='booking_option_id.name') booking_option_price=fields.Monetary('Price',currency_field='currency_id') diff --git a/models/booking_event_registration.py b/models/booking_event_registration.py index 2337aad..f094269 100644 --- a/models/booking_event_registration.py +++ b/models/booking_event_registration.py @@ -73,6 +73,7 @@ class EventRegistration(models.Model): age=fields.Integer('Age') gender=fields.Selection([('male','Male'),('femelle','Femelle')],string='gender') mobile=fields.Char('Mobile') + kanban_color=fields.Char('kanban color',compute='_compute_kanban_color') invoice_state=fields.Selection(related='invoice_id.payment_state') @@ -106,7 +107,16 @@ class EventRegistration(models.Model): if rec.down_payment_invoice_state!='paid':rec.payment_status='down payment not paid' if rec.down_payment_invoice_state=='paid' and rec.balance_payment_invoice_state=='paid' :rec.payment_status='paid' if rec.down_payment_invoice_state=='paid' and rec.balance_payment_invoice_state!='paid':rec.payment_status='down payment paid' + + if rec.payment_status=='paid': + rec.state='open' + else: + rec.state='draft' + + # @api.onchange('payment_status') + # def _onchange_payment_status(self): + # if self.payment_status=='paid' :self.state='open' def _compute_kanban_color(self): for rec in self: diff --git a/models/booking_product.py b/models/booking_product.py index 1ff56de..9ab40f5 100644 --- a/models/booking_product.py +++ b/models/booking_product.py @@ -10,6 +10,7 @@ class ProductTemplate(models.Model): booking_product = fields.Boolean(string="booking product", tracking=True) booking_option_product = fields.Boolean(string="booking option product", tracking=True) + booking_option_product_backoffice = fields.Boolean(string="booking option product for backoffice", tracking=True) # def _get_special_price(self, combination=False, product_id=False, add_qty=1, pricelist=False, parent_combination=False, only_template=False): diff --git a/static/js/booking.js b/static/js/booking.js index 6745efa..45bd329 100644 --- a/static/js/booking.js +++ b/static/js/booking.js @@ -29,6 +29,45 @@ odoo.define('booking.main', function (require) { }); + + $( "#continue_button" ).click(function() { + if ($('#email').val()=='' && $('#mobile').val()=='' && $('#phone').val()=='') + { + $('#validation_message').text('merci de saisir un email ou un mobile ou un téléphone') + $('#validation_message').show() + } + else + { + if ($('#name').val()=='') + { + $('#validation_message').text('merci de saisir un nom') + $('#validation_message').show() + + + } + else if ($('#firstname').val()=='') + { + $('#validation_message').text('merci de saisir un prénom') + $('#validation_message').show() + + + } + else if ($('#age').val()=='') + { + $('#validation_message').text('merci de saisir l\'age du participant') + $('#validation_message').show() + + + } + else + { + $('#form1').submit() + } + + + + } + }); $( "#back_button2" ).click(function() { history.back() diff --git a/views/booking_website_registration.xml b/views/booking_website_registration.xml index 0088b7e..26f3e60 100644 --- a/views/booking_website_registration.xml +++ b/views/booking_website_registration.xml @@ -52,7 +52,7 @@

Please select your booking options :


-
+ @@ -152,7 +152,7 @@
- +
@@ -174,12 +174,13 @@
- +
+ - +
diff --git a/views/event.xml b/views/event.xml index 7d2d8d9..4b150de 100644 --- a/views/event.xml +++ b/views/event.xml @@ -149,4 +149,20 @@ + + kalachakra.event.search + event.event + + + + + + + + + diff --git a/views/product.xml b/views/product.xml index 8d20068..000f39d 100644 --- a/views/product.xml +++ b/views/product.xml @@ -13,6 +13,7 @@ +