diff --git a/controllers/booking.py b/controllers/booking.py index 78f866b..107af1e 100755 --- a/controllers/booking.py +++ b/controllers/booking.py @@ -42,7 +42,7 @@ class booking(WebsiteEventController,AuthSignupHome): data['event']=event request.session['individual_booking_event']=event.individual_booking_event - + data['individual_booking_event']=event.individual_booking_event diff --git a/controllers/kalachakra.py b/controllers/kalachakra.py index 59a91f9..05036c8 100755 --- a/controllers/kalachakra.py +++ b/controllers/kalachakra.py @@ -888,7 +888,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): PaymentProcessing.remove_payment_transaction(last_tx) PaymentProcessing.add_payment_transaction(transaction) request.session['__website_sale_last_tx_id'] = transaction.id - return transaction.render_donation_button(donation) + return transaction.sudo().render_donation_button(donation) if request.session['kalachakra_transaction'] in ['membership']: diff --git a/models/booking_event_registration.py b/models/booking_event_registration.py index b6d745d..2d99eee 100755 --- a/models/booking_event_registration.py +++ b/models/booking_event_registration.py @@ -418,7 +418,7 @@ class EventRegistration(models.Model): if event.individual_booking_event: vals['name']=event.booking_product_id.name+' du '+str(reg.start_day_individual_booking)+' au '+str(reg.end_day_individual_booking)+ ' - '+str(reg.days_duration)+' jours' else: - vals['name']=event.booking_product_id.name + vals['name']=event.booking_product_id.name+ ' du '+ str(event.date_begin)+' au '+str(event.date_begin) vals['account_id']=int(account_credit.id) @@ -433,7 +433,7 @@ class EventRegistration(models.Model): vals_d['date']=datetime.now() vals_d['partner_id']=int(reg.partner_id) vals_d['product_id']=int(event.booking_product_id) - vals_d['name']=event.booking_product_id.name + vals_d['name']=event.booking_product_id.name + ' du '+ str(event.date_begin)+' au '+str(event.date_begin) vals_d['account_id']=int(account_debit.id) vals_d['quantity']=1 vals_d['price_unit']=product_price @@ -572,7 +572,7 @@ class EventRegistration(models.Model): vals['name']='Acompte '+event.booking_product_id.name+' du '+str(reg.start_day_individual_booking)+' au '+str(reg.end_day_individual_booking)+ '- '+str(reg.days_duration)+' jour(s)' else: vals['price_unit']=event.booking_down_payment - vals['name']='Acompte '+event.booking_product_id.name + vals['name']='Acompte '+event.booking_product_id.name+ ' du '+ str(event.date_begin)+' au '+str(event.date_begin) @@ -685,7 +685,7 @@ class EventRegistration(models.Model): vals_d['date']=datetime.now() vals_d['partner_id']=int(reg.partner_id) vals_d['product_id']=int(event.booking_product_id) - vals_d['name']='solde '+event.booking_product_id.name + vals_d['name']='solde '+event.booking_product_id.name+ ' du '+ str(event.date_begin)+' au '+str(event.date_begin) vals_d['account_id']=int(account_debit.id) vals_d['quantity']=1 if event.individual_booking_event: diff --git a/models/donation.py b/models/donation.py index f3c9953..bc06622 100755 --- a/models/donation.py +++ b/models/donation.py @@ -158,4 +158,4 @@ class DonationDonation(models.Model): return transaction - + # def _generate_invoice_donation(self, vals): diff --git a/models/partner.py b/models/partner.py index 7f8baac..c864db8 100755 --- a/models/partner.py +++ b/models/partner.py @@ -3,6 +3,7 @@ from odoo.exceptions import UserError, ValidationError, Warning from psycopg2 import sql, DatabaseError from datetime import datetime from werkzeug import utils +import re class ResPartner(models.Model): @@ -106,4 +107,14 @@ class ResPartner(models.Model): def unlink(self): # suppression du compte utilisateur lié au contact self.env['res.users'].sudo().search([('partner_id','=',int(self.id))]).unlink() - return super(ResPartner, self).unlink() \ No newline at end of file + return super(ResPartner, self).unlink() + + @api.constrains('email') + def _onchange_email(self): + if self.email: + if not self.image_1920 and self._context.get('gravatar_image') and self.email: + self.image_1920 = self._get_gravatar_image(self.email) + regex = re.compile(r'([A-Za-z0-9-]+[.-_])*[A-Za-z0-9-]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+') + if not re.fullmatch(regex, self.email): + + raise ValidationError('Invalid email') \ No newline at end of file diff --git a/static/js/booking.js b/static/js/booking.js index 92038e9..dc49758 100755 --- a/static/js/booking.js +++ b/static/js/booking.js @@ -4,6 +4,11 @@ odoo.define('booking.main', function (require) { var _t = core._t; $(document).ready(function() { + if ($("#individual_booking_event").val()=='True') + { + $("#continue_button").hide() + } + $('#datetimepickerstart_day').datetimepicker({ format: 'DD/MM/YYYY', diff --git a/views/booking_website_registration.xml b/views/booking_website_registration.xml index 0f64041..cfc6e75 100755 --- a/views/booking_website_registration.xml +++ b/views/booking_website_registration.xml @@ -41,7 +41,9 @@
Registering to :


+
From to
+
Your status :