From 846fce4eff72a9e22506f4a58f980aa438f1eef5 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jun 2022 09:59:02 +0200 Subject: [PATCH] adhesion soutien --- controllers/kalachakra.py | 10 ++++++++++ models/event.py | 1 + static/js/kalachakra.js | 6 ++++++ views/event.xml | 2 +- views/event_templates_list.xml | 7 ++++++- views/website_event_registration.xml | 12 ++++++------ views/website_participation.xml | 24 ++++++++++++++++++++++++ 7 files changed, 54 insertions(+), 8 deletions(-) diff --git a/controllers/kalachakra.py b/controllers/kalachakra.py index 3fe9356..ff6a2f7 100644 --- a/controllers/kalachakra.py +++ b/controllers/kalachakra.py @@ -345,7 +345,17 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing): #membership product data['products']=p + + if type=='super_membership': + request.session['kalachakra_transaction']='super_membership' + data['kalachakra_transaction']='super_membership' + data['title']='Become a super member' + p=request.env['product.product'].sudo().search([('super_membership_product','=',True)],limit=1) + if not p: raise UserError(_('No membership product, please add one')) + data['amount']=p.list_price + #super membership product + data['products']=p userid=request.env.context.get('uid') diff --git a/models/event.py b/models/event.py index 99717c7..e6cc2a7 100644 --- a/models/event.py +++ b/models/event.py @@ -53,6 +53,7 @@ class KalachakraEvent(models.Model): recurring_event=fields.Boolean('Recurring event') recurring_event_newsletter_id=fields.Many2one('mailing.list',string='Recurring event Newsletter') online_event=fields.Boolean('Online event') + onthespot_event=fields.Boolean('Online event') online_link=fields.Char('link') online_id=fields.Char('id') online_password=fields.Char('password') diff --git a/static/js/kalachakra.js b/static/js/kalachakra.js index 3f7e4f0..49fd295 100644 --- a/static/js/kalachakra.js +++ b/static/js/kalachakra.js @@ -31,6 +31,12 @@ odoo.define('kalachakra.main', function (require) { $( "#form" ).submit(); }); + $( "#make_donation_btn" ).click(function() { + + $('#form').attr('action', '/kalachakra/participation?type=donation'); + $( "#form" ).submit(); + }); + $( "#pay_on_the_spot_btn" ).click(function() { diff --git a/views/event.xml b/views/event.xml index 85d87b5..d494f8a 100644 --- a/views/event.xml +++ b/views/event.xml @@ -82,7 +82,7 @@ - + diff --git a/views/event_templates_list.xml b/views/event_templates_list.xml index 381c443..0d15f45 100644 --- a/views/event_templates_list.xml +++ b/views/event_templates_list.xml @@ -49,7 +49,12 @@