diff --git a/__manifest__.py b/__manifest__.py index ff3ef46..62fa61b 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -55,6 +55,7 @@ 'views/booking_room.xml', 'views/booking_questionnaire.xml', 'views/mailing_list.xml', + 'views/ir.attachment.xml', ], diff --git a/controllers/booking.py b/controllers/booking.py index c374bc3..abbb60d 100644 --- a/controllers/booking.py +++ b/controllers/booking.py @@ -75,7 +75,7 @@ class booking(WebsiteEventController,AuthSignupHome): data['questions']=event.question_ids - + request.session['invoice_id']=False return http.request.render('kalachakra.booking_registration_options_form',data) @http.route(['/booking/registration/questionnaire'], type='http', auth='user', website=True, sitemap=False,csrf=False) @@ -85,9 +85,10 @@ class booking(WebsiteEventController,AuthSignupHome): #gestion du retour page précédente depuis page de paiement : on supprime les éléments générés ( don , adhésion) if not post.get('nb_o'): - invoice=request.env['account.move'].sudo().search([("id","=",int(request.session['invoice_id']))]) - invoice.state='draft' - invoice.unlink() + if request.session['invoice_id']: + invoice=request.env['account.move'].sudo().search([("id","=",int(request.session['invoice_id']))]) + invoice.state='draft' + invoice.unlink() return request.redirect('/booking/registration/options?event_id='+str(request.session['event_id'])) vals['event_id']=post.get('event_id') diff --git a/models/booking_event_registration.py b/models/booking_event_registration.py index fcd4bcf..09f8020 100644 --- a/models/booking_event_registration.py +++ b/models/booking_event_registration.py @@ -250,6 +250,8 @@ class EventRegistration(models.Model): if status!="super member": product_price=event.booking_member_price + if self.payment_adjustement!=0: + product_price=product_price+self.payment_adjustement #calcul du montant total à régler diff --git a/static/js/booking.js b/static/js/booking.js index 03ef346..20a6130 100644 --- a/static/js/booking.js +++ b/static/js/booking.js @@ -40,6 +40,7 @@ odoo.define('booking.main', function (require) { $(":checkbox").change(function() { + //si coche adhésion alors le statut devient membre if(this.value==$("#membership_product").val() && this.checked) { @@ -47,6 +48,7 @@ odoo.define('booking.main', function (require) { } + //si décoche adhésion alors le statut devient non membre if(this.value==$("#membership_product").val() && this.checked==false) { if ($("#status").val()=='not member'){$("#status2").val('not member')} @@ -55,10 +57,11 @@ odoo.define('booking.main', function (require) { - + //recalcul du prix total if ($("#status2").val()=='not member') { + $("#your_status").text('non adhérent') $("#price_of_the_stay").text($("#booking_price").val()+' €') diff --git a/views/booking_website_registration.xml b/views/booking_website_registration.xml index 290f1ef..84ed08f 100644 --- a/views/booking_website_registration.xml +++ b/views/booking_website_registration.xml @@ -32,14 +32,23 @@
Total Price :
- Do you want to pay only the deposit -
- +
+ +

Please select your booking options :


@@ -52,8 +61,8 @@ - - + + @@ -277,6 +286,8 @@
+
+ diff --git a/views/ir.attachment.xml b/views/ir.attachment.xml new file mode 100644 index 0000000..40d2cb6 --- /dev/null +++ b/views/ir.attachment.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file