Browse Source

facturation

dev-rcn
root 3 years ago
parent
commit
96fe712c32
16 changed files with 926 additions and 310 deletions
  1. +1
    -1
      __manifest__.py
  2. +21
    -70
      controllers/booking.py
  3. +136
    -58
      controllers/kalachakra.py
  4. +172
    -80
      i18n/fr.po
  5. +404
    -18
      models/booking_event_registration.py
  6. +7
    -0
      models/event.py
  7. +1
    -1
      models/partner.py
  8. +3
    -1
      models/product.py
  9. +11
    -4
      views/booking_event_registration.xml
  10. +2
    -2
      views/booking_event_templates_list.xml
  11. +4
    -4
      views/booking_website_registration.xml
  12. +4
    -4
      views/event.xml
  13. +56
    -12
      views/event_templates_list.xml
  14. +1
    -1
      views/product.xml
  15. +87
    -47
      views/website_event_registration.xml
  16. +16
    -7
      views/website_participation.xml

+ 1
- 1
__manifest__.py View File

@ -48,7 +48,7 @@
'views/booking_event_registration.xml',
'views/booking_website_registration.xml',
'views/booking_registration.xml',
'views/booking_event_templates_list.xml',
#'views/booking_event_templates_list.xml',
#'views/booking_event_templates_page_registration.xml',
'views/booking_location.xml',
'views/booking_room.xml',


+ 21
- 70
controllers/booking.py View File

@ -78,7 +78,7 @@ class booking(WebsiteEventController,AuthSignupHome):
return http.request.render('booking.registration_options_form',data)
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)
def bookingregistration_questionnaire(self,**post):
@ -125,7 +125,7 @@ class booking(WebsiteEventController,AuthSignupHome):
if event.question_ids:
data['questions']=event.question_ids
#return vals3
return http.request.render('booking.registration_questionnaire_form',data)
return http.request.render('kalachakra.booking_registration_questionnaire_form',data)
@http.route(['/booking/payment_choice'], type='http',auth='user', website=True, sitemap=False,csrf=False)
def bookinginvoice(self,**post):
@ -151,7 +151,7 @@ class booking(WebsiteEventController,AuthSignupHome):
vals['state']='draft'
res=request.env['event.registration'].sudo().create(vals)
request.session['res_id']=res.id
vals2={}
#questionnaire'
@ -189,9 +189,16 @@ class booking(WebsiteEventController,AuthSignupHome):
res.write({'option_ids':[(4,res3.id)]})
i=i+1
invoice=request.env['event.registration'].sudo().action_event_registration_generate_invoice(request.session['res_id'])
#redirection sur la page de paiement de la facture :
url="/my/invoices/"+str(invoice.id)#+"?access_token="+str(invoice.access_token)
return request.redirect(url)
#création du devis
#création du devis pour la transaction
order_id=request.env['event.registration'].sudo().action_event_registration_generate_order(res.id)
order=request.env['sale.order'].sudo().search([("id","=",int(order_id))])
data={}
@ -218,7 +225,7 @@ class booking(WebsiteEventController,AuthSignupHome):
data['order_id']=order_id
return http.request.render('booking.payment_choice_form',data)
return http.request.render('kalachakra.booking_payment_choice_form',data)
#return http.request.redirect(order.access_url)
@ -265,7 +272,7 @@ class booking(WebsiteEventController,AuthSignupHome):
if token:
vals['payment_token_id'] = int(token)
transaction = order._create_payment_transaction(vals)
transaction = order.sudo()._create_payment_transaction(vals)
# store the new transaction into the transaction list and if there's an old one, we remove it
# until the day the ecommerce supports multiple orders at the same time
@ -320,25 +327,19 @@ class booking(WebsiteEventController,AuthSignupHome):
@http.route('/booking/payment/validate', type='http', auth="public", website=True, sitemap=False)
def booking_payment_validate(self, transaction_id=None, sale_order_id=None, **post):
""" Method that should be called by the server when receiving an update
for a transaction. State at this point :
- UDPATE ME
"""
#suppression du devis et création de la facture au statut payé
order_id=int(request.session['order_id'])
order=request.env['sale.order'].search([('id','=',order_id)])
order.state='sale'
request.session['order_id']=None
#request.env['sale.order'].search([('id','=',order_id)]).unlink()
invoice=request.env['event.registration'].sudo().action_event_registration_generate_invoice(request.session['res_id'],'electronic')
invoice.action_post()
request.session['order_id']=None
transaction_id=int(request.session['__website_sale_last_tx_id'] )
tx = request.env['payment.transaction'].sudo().browse(transaction_id)
PaymentProcessing.remove_payment_transaction(tx)
return request.redirect('/booking/payment/confirmation')
@ -347,55 +348,5 @@ class booking(WebsiteEventController,AuthSignupHome):
@http.route(['/booking/payment/confirmation'], type='http', auth="public", website=True, sitemap=False)
def booking_payment_confirmation(self, **post):
return request.render("booking.thankyou")
return request.render("kalachakra.booking_thankyou")
# class CustomerPortal(CustomerPortal):
# #affichage de la page de paiement
# @http.route(['/my/quotes', '/my/quotes/page/<int:page>'], type='http', auth="user", website=True)
# def portal_my_quotes(self, page=1, date_begin=None, date_end=None, sortby=None, **kw):
# values = self._prepare_portal_layout_values()
# partner = request.env.user.partner_id
# SaleOrder = request.env['sale.order']
# #return str(len(SaleOrder))
# domain = [('partner_id','=',int(partner.id)),('state','in',('draft','sent'))]
# searchbar_sortings = {
# 'date': {'label': _('Order Date'), 'order': 'date_order desc'},
# 'name': {'label': _('Reference'), 'order': 'name'},
# 'stage': {'label': _('Stage'), 'order': 'state'},
# }
# # default sortby order
# if not sortby:
# sortby = 'date'
# sort_order = searchbar_sortings[sortby]['order']
# if date_begin and date_end:
# domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
# # count for pager
# quotation_count = SaleOrder.search_count(domain)
# # make pager
# pager = portal_pager(
# url="/my/quotes",
# url_args={'date_begin': date_begin, 'date_end': date_end, 'sortby': sortby},
# total=quotation_count,
# page=page,
# step=self._items_per_page
# )
# # search the count to display, according to the pager data
# quotations = SaleOrder.search(domain, order=sort_order, limit=self._items_per_page, offset=pager['offset'])
# request.session['my_quotations_history'] = quotations.ids[:100]
# values.update({
# 'date': date_begin,
# 'quotations': quotations.sudo(),
# 'page_name': 'quote',
# 'pager': pager,
# 'default_url': '/my/quotes',
# 'searchbar_sortings': searchbar_sortings,
# 'sortby': sortby,
# })
# return request.render("sale.portal_my_quotations", values)

+ 136
- 58
controllers/kalachakra.py View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from odoo import http
from odoo import http,_
from odoo.http import request
from odoo import models, fields, api
import werkzeug
from datetime import datetime
from odoo.tools import format_datetime, format_date, is_html_empty
@ -11,7 +12,7 @@ from odoo.addons.payment.controllers.portal import PaymentProcessing
#from odoo.addons.auth_signup.controllers.main import AuthSignupHome
from odoo.addons.sale.controllers.portal import CustomerPortal
from odoo.addons.portal.controllers.portal import pager as portal_pager, get_records_pager
import json
class kalachakra_event(WebsiteEventController,PaymentProcessing):
@ -44,7 +45,126 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
return http.request.redirect('https://www.dropbox.com/s/ijsd6n82oyp0gw8/programme_Paris.pdf?dl=0')
@http.route(['/kalachakra/object'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def object(self,model,id,*args,**kw):
field_list=request.env[model].sudo().fields_get()
objet=request.env[model].search([('id','=',int(id))])
# result=[]
# for key in field_list:
# result.append((key,str(objet[key])))
# result.sort()
# return json.dumps(result)
result=""
for key in field_list:
result=result+str(key)+':'+str(objet[key])+'<br>'
return result
return model_id+ record_id
@http.route(['/kalachakra/inv'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def object3(self,id,*args,**kw):
move=request.env['account.move'].search([('id','=',int(id))])
if move.state != 'posted' \
or move.payment_state not in ('not_paid', 'partial') \
or not move.is_invoice(include_receipts=True):
return "KO"
pay_term_lines = move.line_ids\
.filtered(lambda line: line.account_id.user_type_id.type in ('receivable', 'payable'))
domain = [
('account_id', 'in', pay_term_lines.account_id.ids),
('move_id.state', '=', 'posted'),
('partner_id', '=', move.commercial_partner_id.id),
('reconciled', '=', False),
'|', ('amount_residual', '!=', 0.0), ('amount_residual_currency', '!=', 0.0),
]
payments_widget_vals = {'outstanding': True, 'content': [], 'move_id': move.id}
if move.is_inbound():
domain.append(('balance', '<', 0.0))
payments_widget_vals['title'] = _('Outstanding credits')
else:
domain.append(('balance', '>', 0.0))
payments_widget_vals['title'] = _('Outstanding debits')
# lines=request.env['account.move.line'].search(domain)
# if not lines:
# return json.dumps(domain)
result="currency_id="+str(move.currency_id)+'<br>'
result=result+"is_invoice="+str(move.is_invoice())+'<br>'
result=result+"state="+str(move.state)+'<br>'
result=result+"currency.is_zero(invoice.amount_residual)="+str(move.amount_residual)+'<br>'
for line in move.line_ids:
amount = move.company_currency_id._convert(
abs(line.amount_residual),
move.currency_id,
move.company_id,
line.date,
)
amount = abs(line.amount_residual_currency)
result=result+"id="+str(line.id)+'<br>'
result=result+"account_id="+str(line.account_id)+'<br>'
result=result+"domain="+json.dumps(domain)+'<br>'
result=result+"move_id.state="+str(line.move_id.state)+'<br>'
result=result+"partner_id="+str(line.partner_id)+'<br>'
result=result+"reconciled="+str(line.reconciled)+'<br>'
result=result+"amount_residual="+str(line.amount_residual)+'<br>'
result=result+"amount_residual_currency="+str(line.amount_residual_currency)+'<br>'
result=result+"domain="+str(domain)+'<br>'
result=result+"amount="+str(amount)+'<br>'
result=result+"move.currency_id.is_zero(amount)="+str(move.currency_id.is_zero(amount))+'<br>'
result=result+"currency_id="+str(line.currency_id)+'<br>'
result=result+"line.account_id.reconcile="+str(line.account_id.reconcile)+'<br>'
result=result+"line.account_id.user_type_id.type="+str(line.account_id.user_type_id.type)+'<br>'
result=result+"line.amount_residual"+str(line.amount_residual)+'<br>'
result=result+"balance="+str(line.balance)+'<br>'
#if line.id and (line.account_id.reconcile or line.account_id.internal_type == 'liquidity'):
result=result+"OK<br>"
reconciled_balance = sum(line.matched_credit_ids.mapped('amount')) \
- sum(line.matched_debit_ids.mapped('amount'))
reconciled_amount_currency = sum(line.matched_credit_ids.mapped('debit_amount_currency'))\
- sum(line.matched_debit_ids.mapped('credit_amount_currency'))
result=result+str(reconciled_balance)+'<br>'
result=result+str(reconciled_amount_currency)+'<br>'
result=result+'<br></br>'
return result
@http.route(['/kalachakra/update'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def object2(self,*args,**kw):
objet=request.env['account.move'].search([('id','=',108)])
#objet.payment_reference='REC108'
objet.posted_before=True
return "ok"
return http.request.redirect('https://www.dropbox.com/s/ijsd6n82oyp0gw8/programme_Paris.pdf?dl=0')
@http.route(['/event/registration/step1'], type='http', auth='user', website=True, sitemap=False,csrf=False)
def event_registration_step1(self,event_id,*args,**kw):
@ -71,10 +191,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
data['status']=partner.member_status
if data['status']=='not member':data['status']='standard'
#prix
data['price']=''
if data['status']=='standard':data['price']=event.booking_price
if data['status']=='member':data['price']=event.booking_member_price
if data['status']=='super member':data['price']=event.booking_super_member_price
request.session['status']=data['status']
return http.request.render('kalachakra.registration_step1',data)
@ -86,58 +203,16 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
data['event']=event
data['online']=post.get('online')
data['status']=request.session['status']
data['price']=''
if data['status']=='standard':data['participation_amount']=int(event.participation_standard_price)
if data['status']=='member':data['participation_amount']=int(event.participation_member_price)
if data['status']=='super member':data['participation_amount']=int(event.participation_super_member_price)
return http.request.render('kalachakra.registration_step2',data)
@http.route(['/kalachakra/makedonation'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def makedonation(self,**post):
data={}
userid=request.env.context.get('uid')
#title options
title=request.env['res.partner.title'].sudo().search([])
data['titles']=title
title_male=request.env['res.partner.title'].sudo().search([('name','=','Monsieur')])
#country options
country=request.env['res.country'].sudo().search([])
data['countries']=country
country_france=request.env['res.country'].sudo().search([('name','=','France')])
if userid:
user=request.env['res.users'].search([('id','=',int(userid))])
partner=request.env['res.partner'].sudo().search([('id','=',int(user.partner_id))])
request.session['partner_id']=int(partner.id)
data['partner']=partner
else:
partner=request.env['res.partner']
partner.email=''
partner.title=title_male.id
partner.country_id=country_france.id
partner.firstname=''
partner.name=''
partner.street=''
partner.street2=''
partner.zip=''
data['partner']=partner
data['amount']=10
return http.request.render('kalachakra.makedonation_form',data)
@http.route(['/kalachakra/participation'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def participation(self,type=None,**post):
data={}
@ -153,13 +228,14 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
request.session['kalachakra_transaction']='membership'
data['kalachakra_transaction']='membership'
data['title']='Become a member'
p=request.env['product.template'].search([('membership_product','=',True)])
p=request.env['product.product'].search([('membership_product','=',True)])
if not p: raise UserError(_('No membership product, please add one'))
data['amount']=p.list_price
#membership product
data['products']=p
userid=request.env.context.get('uid')
#title options
@ -204,7 +280,8 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
@http.route(['/kalachakra/payment_choice'], type='http', auth='public', website=True, sitemap=False,csrf=False)
def payment_choice(self,**post):
#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('product_id'):
if request.session['kalachakra_transaction']=='donation':
@ -288,7 +365,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
vals={}
#create line donation
vals['donation_id']=donation_draft.id
product=request.env['product.product'].search([('id','=',int(post.get('product_id')))])
product=request.env['product.template'].search([('id','=',int(post.get('product_id')))])
vals['product_id']=int(post.get('product_id'))
vals['display_name']=product.name
vals['quantity']=1
@ -314,7 +391,7 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
data['order_id']=membership.id
request.session['membership_id'] = membership.id
return http.request.render('kalachakra.payment_choice_form',data)
return http.request.render('kalachakra.kalachakra_payment_choice_form',data)
@http.route(['/kalachakra/payment/transaction/',
@ -374,7 +451,8 @@ class kalachakra_event(WebsiteEventController,PaymentProcessing):
return transaction.render_donation_button(donation)
if request.session['kalachakra_transaction'] in ['membership']:
# Retrieve the donation
# Retrieve the membeship
membership_id=order_id
membership=request.env['kalachakra.membership'].search([('id','=',int(membership_id))], limit=1)


+ 172
- 80
i18n/fr.po View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0-20210413\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-06 19:21+0000\n"
"PO-Revision-Date: 2022-06-06 19:21+0000\n"
"POT-Creation-Date: 2022-06-08 11:37+0000\n"
"PO-Revision-Date: 2022-06-08 11:37+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -21,19 +21,19 @@ msgid "(only"
msgstr "("
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "(standard price :"
msgstr "(Participation standard :"
msgstr "(prix non adhérent :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ", member price :"
msgstr ", participation membre:"
msgstr ", prix adhérent :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ", super member price :"
msgstr ", participation membre de soutien :"
msgstr ", prix membre de soutien :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_template_donation_tax_receipt
@ -50,6 +50,13 @@ msgstr ""
msgid "<b>Paris, le</b> {{DATE}}"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.events_list
msgid ""
"<font style=\"color: rgb(255, 0, 0);font-size: 14px;\">Participation "
"libre</font>"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_category_tag
msgid ""
@ -58,14 +65,14 @@ msgid ""
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">Age</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">First name</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
@ -74,7 +81,7 @@ msgstr ""
" <span class=\"s_website_form_mark\"> *</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">Gender</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
@ -83,39 +90,39 @@ msgstr ""
" <span class=\"s_website_form_mark\"> *</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid ""
"<span class=\"s_website_form_label_content\">Informations de nature médicale utiles à connaître (allergies, prise de médicaments, contre-indications…)</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid ""
"<span class=\"s_website_form_label_content\">Medical concern</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
msgstr ""
"<span class=\"s_website_form_label_content\">Renseignements médicaux</span>\n"
"<span class=\"s_website_form_label_content\">Information médicale</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">Mobile</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid ""
"<span class=\"s_website_form_label_content\">Name of the medical contact</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
"<span class=\"s_website_form_label_content\">Nom du contact</span>\n"
"<span class=\"s_website_form_label_content\">Nom/span>\n"
" <span class=\"s_website_form_mark\"/>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">Name</span>\n"
" <span class=\"s_website_form_mark\"> *</span>"
@ -124,43 +131,46 @@ msgstr ""
" <span class=\"s_website_form_mark\"> *</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid ""
"<span class=\"s_website_form_label_content\">Phone of the medical contact</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
"<span class=\"s_website_form_label_content\">Téléphone</span>\n"
" <span class=\"s_website_form_mark\"/>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">Phone</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
"<span class=\"s_website_form_label_content\">Téléphone</span>\n"
" <span class=\"s_website_form_mark\"/>"
"<span class=\"s_website_form_label_content\">téléphone</span>\n"
" <span class=\"s_website_form_mark\"/>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid ""
"<span class=\"s_website_form_label_content\">To stay informed I subscribe to"
" the newsletter of the center</span>"
msgstr "<span class=\"s_website_form_label_content\">Pour être informé,je m'inscris"
msgstr ""
"<span class=\"s_website_form_label_content\">Pour être informé, je m'inscris"
" à la liste de diffusion du centre</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid ""
"<span class=\"s_website_form_label_content\">email</span>\n"
" <span class=\"s_website_form_mark\"/>"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "<span>Do you want to pay only the deposit </span>"
msgstr "<span>Vous voulez régler avec un acompte ? </span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid "<u>Health quiz</u>"
msgstr "<u>Questionnaire de santé</u>"
@ -172,7 +182,7 @@ msgid ""
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
msgid "<u>Questionnaire :</u>"
msgstr ""
@ -199,18 +209,26 @@ msgid ""
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_view_form
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_event_view_form
msgid "Add event to google agenda"
msgstr "Ajouter l'événement au calendrier google"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__statut_contact__adherent
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Adhérent"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.events_list
msgid "Adhérent et autres :"
msgid "Adhérent :"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Adhérent de soutien"
msgstr ""
#. module: kalachakra
@ -293,6 +311,11 @@ msgstr ""
msgid "BENEFICIAIRE DES VERSEMENTS"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__balance_invoice_id
msgid "Balance Invoice"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__balance_order_id
msgid "Balance Order"
@ -301,12 +324,17 @@ msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Become a member"
msgstr "Devenir membre"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
msgid "Become a member :"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Become a super member"
msgstr ""
msgstr "Devenir membre de soutien"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__origine__bercy
@ -349,7 +377,7 @@ msgstr "Sejour/ Retraite"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.product_template_search_view
msgid "Booking option products"
msgstr ""
msgstr "Produits d'options"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.product_template_search_view
@ -378,8 +406,8 @@ msgid "Contact"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
msgid "Continue"
msgstr "Suite"
@ -435,6 +463,7 @@ msgstr "Créé le"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_booking_option__currency_id
#: model:ir.model.fields,field_description:kalachakra.field_event_event__currency_id
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__currency_id
#: model:ir.model.fields,field_description:kalachakra.field_event_registration_option__currency_id
#: model:ir.model.fields,field_description:kalachakra.field_kalachakra_membership__currency_id
msgid "Currency"
@ -501,6 +530,11 @@ msgstr "Dons"
msgid "Donations"
msgstr "Dons"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__down_payment_invoice_id
msgid "Down Payment Invoice"
msgstr "Facture d'acompte"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__down_payment_order_id
msgid "Down Payment Order"
@ -564,12 +598,12 @@ msgstr ""
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_registration__gender__femelle
msgid "Femelle"
msgstr ""
msgstr "Femme"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__firstname
msgid "Firstname"
msgstr "Femme"
msgstr "Prénom"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
@ -586,12 +620,17 @@ msgid "Free participation"
msgstr "Participation libre"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "From"
msgstr "Du"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_registration_view_form
msgid "Generate invoice(s)"
msgstr "Générer le(s) facture(s)"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_registration_view_form
msgid "Generate quotation(s)"
@ -600,7 +639,7 @@ msgstr "Générer le(s) devis"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Here is the information to attend on Zoom :"
msgstr "Voici les informations pour participer sur Zoom"
msgstr "Voici les informations pour participer sur Zoom :"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_registration__medical_concern__no_answer
@ -610,17 +649,17 @@ msgstr "Je ne veux pas répondre"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_registration__medical_concern__have_medical_concern
msgid "I have a medical concern to report"
msgstr ""
msgstr "J'ai une information médicale à signaler"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_registration__medical_concern__have_no_medical_concern
msgid "I have no medical concern to report"
msgstr "J'ai un problème médical à signaler"
msgstr "Je n'ai pas d'information médicale à signaler"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "I pay the participation now"
msgstr "Je n'ai pas de problème médical à signaler"
msgstr "Je règle ma participation maintenant"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
@ -658,12 +697,12 @@ msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "If you want to be a member, click here :"
msgstr "Si vous voulez devenir membre, cliquez ici"
msgstr "Si vous voulez devenir adhérent, cliquez ici :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "If you want to be a super member, click here :"
msgstr "Si vous voulez devenir membre de soutien, cliquez ici"
msgstr "Si vous voulez devenir adhérent de soutien, cliquez ici :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
@ -704,6 +743,11 @@ msgstr ""
msgid "Invalid token found! Token partner %s != %s"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__invoice_id
msgid "Invoice"
msgstr "facture"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
msgid "Je choisirai plus tard"
@ -828,6 +872,11 @@ msgstr ""
msgid "Make a donation"
msgstr "Faire un don"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
msgid "Make donation :"
msgstr "Faire un don"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_registration__gender__male
msgid "Male"
@ -836,7 +885,7 @@ msgstr "Homme"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__medical_concern
msgid "Medical concern"
msgstr "Problème médical"
msgstr "Information médicale"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__medical_information
@ -847,16 +896,16 @@ msgstr "Informations médicales"
#: model:ir.model.fields.selection,name:kalachakra.selection__event_partner_category__status__member
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__member_status__member
msgid "Member"
msgstr "Membre"
msgstr "Adhérent"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_booking_option__booking_option_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__booking_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__participation_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__subscription_member_price
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Member price"
msgstr "Participation membre"
msgstr "Participation adhérent"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_payment_transaction__membership_ids
@ -924,6 +973,12 @@ msgstr "Pas de produit d'adhésion, ajoutez-en un"
msgid "Nom du fichier"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Non adhérent"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.events_list
msgid "Non adhérent :"
@ -932,7 +987,7 @@ msgstr ""
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__member_status__not_member
msgid "Not member"
msgstr "Non membre"
msgstr "Non adhérent"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_template_donation_tax_receipt
@ -969,18 +1024,23 @@ msgstr ""
msgid "Online event"
msgstr "Evénement en ligne"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_event_view_form
msgid "Online options"
msgstr "options Réunion en ligne"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__option_ids
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Option"
msgstr "Option"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_event_type_view_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_event_view_form
#: model_terms:ir.ui.view,arch_db:kalachakra.event_registration_view_form
msgid "Options"
msgstr "Options"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_registration__order_id
@ -1004,10 +1064,15 @@ msgid ""
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Participant :"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_event_view_form
msgid "Participations"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_partner_category__partner_category_id
msgid "Partner Category"
@ -1028,7 +1093,8 @@ msgid "Pay Now"
msgstr "Régler maintenant"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.payment_choice_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_payment_choice_form
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_payment_choice_form
msgid "Pay with"
msgstr "Régler avec"
@ -1058,9 +1124,9 @@ msgid "Phone of the contact"
msgstr "Téléphone du contact"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Please select your booking options :"
msgstr "Merci de sélectionner vos options du séjour"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__origine__portes_ouvertes_st_cosme
@ -1080,7 +1146,7 @@ msgid "Price"
msgstr "Participation"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Price of the stay :"
msgstr "Participation du séjour :"
@ -1139,11 +1205,11 @@ msgid "Register"
msgstr "S'inscrire"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Registering to :"
msgstr "S'inscrire à"
msgstr "S'inscrire à :"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__origine__reliques
@ -1151,7 +1217,7 @@ msgid "Reliques"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_view_form
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_event_view_form
msgid "Remove event from google agenda"
msgstr "Supprimer l'événement du calendrier google"
@ -1246,9 +1312,9 @@ msgid "Search registrant"
msgstr "Chercher"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Selection"
msgstr "Sélection"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_template_donation_tax_receipt
@ -1287,7 +1353,7 @@ msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.events_list
msgid "Soutien et Sangha :"
msgid "Soutien :"
msgstr ""
#. module: kalachakra
@ -1299,12 +1365,12 @@ msgstr ""
#: model:ir.model.fields,field_description:kalachakra.field_event_event__participation_standard_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__subscription_standard_price
msgid "Standard Price"
msgstr "Participation standard"
msgstr "Participation non adhérent"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Standard price"
msgstr "Participation standard"
msgstr "participation non adhérent"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_booking_room_occupation__date_begin
@ -1324,7 +1390,7 @@ msgstr "Statut"
#: model:ir.model.fields,field_description:kalachakra.field_res_partner__statut_contact
#: model:ir.model.fields,field_description:kalachakra.field_res_users__statut_contact
msgid "Statut"
msgstr "Statut"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
@ -1340,36 +1406,51 @@ msgstr ""
msgid "Street 2"
msgstr "Rue 2"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.kalachakra_event_view_form
msgid "Subscriptions"
msgstr "Adhésions"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__event_partner_category__status__supermember
msgid "Super Member"
msgstr "Membre de soutien"
msgstr "Adhérent de soutien"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_res_partner__super_member
#: model:ir.model.fields,field_description:kalachakra.field_res_users__super_member
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__member_status__super_member
msgid "Super member"
msgstr "Membre de soutien"
msgstr "Adhérent de soutien"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_booking_option__booking_option_super_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__booking_super_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__participation_super_member_price
#: model:ir.model.fields,field_description:kalachakra.field_event_event__subscription_super_member_price
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Super member price"
msgstr "Participation membre de soutien"
msgstr "Participation adhérent de soutien"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.thankyou
msgid "Thank you for your generosity !"
msgstr "Merci pour votre générosité"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_thankyou
msgid "Thank you for your registration !"
msgstr "Merci pour votre inscription !"
msgstr "Merci pour votre inscription"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "The amount of the contribution is :"
msgstr "Le montant de la participation est de :"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "The participation is free."
msgstr "La participation est libre"
msgstr "La participation est libre."
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
@ -1379,10 +1460,10 @@ msgstr "Titre<span class=\"s_website_form_mark\"> *</span>"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.event_calendartui
msgid "Today"
msgstr "Auourd'hui"
msgstr "Aujourd'hui"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
msgid "Total Price : <span id=\"booking_total_price\"/>"
msgstr "Montant total : <span id=\"booking_total_price\"/>"
@ -1417,7 +1498,12 @@ msgid "Yoga"
msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "You will soon receive a confirmation email."
msgstr "Vous allez bientôt recevoir un e-mail de confirmation."
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "Your status :"
@ -1431,7 +1517,7 @@ msgstr ""
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.participation_form
msgid "Zip"
msgstr ""
msgstr "Code postal"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_kalachakra_partnerdraftfile__active
@ -1455,13 +1541,14 @@ msgid "available)"
msgstr "disponible)"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_questionnaire_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
msgid "back"
msgstr "Retour"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_thankyou
#: model_terms:ir.ui.view,arch_db:kalachakra.thankyou
msgid "back Home"
msgstr "Retour à la page d'accueil"
@ -1538,6 +1625,11 @@ msgstr "brouillon"
msgid "draft partner file"
msgstr ""
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_event_event__duration
msgid "duration"
msgstr "durée"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_kalachakra_membership__end_date
msgid "end date"
@ -1643,7 +1735,7 @@ msgstr "gérer les adhésions"
#. module: kalachakra
#: model:ir.model,name:kalachakra.model_event_partner_category
msgid "map partner categories vs member or super-member for pricing"
msgstr ""
msgstr "lier les catégories de contact"
#. module: kalachakra
#: model:ir.model.fields,field_description:kalachakra.field_booking_location__capacity
@ -1794,7 +1886,7 @@ msgid "super membership product"
msgstr "produit membre de soutien"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.booking_registration_options_form
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step1
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "to"
@ -1808,7 +1900,7 @@ msgstr "adhésions valides"
#. module: kalachakra
#: model_terms:ir.ui.view,arch_db:kalachakra.registration_step2
msgid "your registration is taken into account !"
msgstr "Votre inscrition a bien été prise en compte"
msgstr "Votre inscription a bien été prise en compte !"
#. module: kalachakra
#: model:ir.model.fields.selection,name:kalachakra.selection__res_partner__origine__zoom


+ 404
- 18
models/booking_event_registration.py View File

@ -6,7 +6,6 @@ from datetime import datetime
from werkzeug import utils
class EventRegistration(models.Model):
_inherit = 'event.registration'
@ -55,7 +54,19 @@ class EventRegistration(models.Model):
readonly=True
)
@api.model
def _default_currency(self):
company = self.env['res.company']._company_default_get(
'event.registration')
return company.currency_id
currency_id = fields.Many2one(
'res.currency',
string='Currency',
required=True,
track_visibility='onchange',
ondelete='restrict',
default=_default_currency
)
down_payment=fields.Boolean('down payment',default=False)
firstname=fields.Char('Firstname')
@ -63,12 +74,20 @@ class EventRegistration(models.Model):
gender=fields.Selection([('male','Male'),('femelle','Femelle')],string='gender')
mobile=fields.Char('Mobile')
kanban_color=fields.Char('kanban color',compute='_compute_kanban_color')
order_id=fields.Many2one('sale.order')
order_state=fields.Selection(related='order_id.state')
down_payment_order_id=fields.Many2one('sale.order')
down_payment_order_state=fields.Selection(related='down_payment_order_id.state')
balance_order_id=fields.Many2one('sale.order')
balance_order_state=fields.Selection(related='balance_order_id.state')
invoice_state=fields.Selection(related='invoice_id.state')
down_payment_invoice_state=fields.Selection(related='down_payment_invoice_id.state')
balance_invoice_state=fields.Selection(related='balance_invoice_id.state')
invoice_id=fields.Many2one('account.move')
#invoice_state=fields.Selection(related='invoice_id.state')
down_payment_invoice_id=fields.Many2one('account.move')
#down_payment_invoice_state=fields.Selection(related='down_payment_order_id.state')
balance_invoice_id=fields.Many2one('account.move')
#balance_invoice_state=fields.Selection(related='balance_order_id.state')
payment_status=fields.Char(string='payment status',compute='_compute_payment_status')
@ -76,16 +95,16 @@ class EventRegistration(models.Model):
def _compute_payment_status(self):
for rec in self:
rec.payment_status='undefined'
if rec.order_id:
if rec.order_state in ('draft','sent'):rec.payment_status='not paid'
if rec.order_state=='sale':rec.payment_status='paid'
if rec.order_state in ('done','cancel'):rec.payment_status=rec.order_state
if rec.invoice_id:
if rec.invoice_state not in ('paid'):rec.payment_status='not paid'
if rec.invoice_state=='paid':rec.payment_status='paid'
else:
if rec.down_payment_order_id and balance_order_state:
if rec.down_payment_order_state in ('draft','sent'):rec.payment_status='down payment not paid'
if rec.down_payment_order_state=='sale' and rec.balance_payment_order_state=='sale' :rec.payment_status='paid'
if rec.down_payment_order_state=='sale' and rec.balance_payment_order_state!='sale':rec.payment_status='down payment paid'
if rec.down_payment_invoice_id and balance_invoice_id:
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'
@ -335,8 +354,370 @@ class EventRegistration(models.Model):
reg.balance_order_id=order2.id
return order.id
def action_event_registration_generate_invoice(self,id_registration=None):
#suppression des factures existantes
# if self.invoice_id:
# self.env['account.move'].search([('id','=',int(self.invoice_id))]).unlink()
# self.invoice_id=False
# if self.down_payment_invoice_id:
# self.env['account.move'].search([('id','=',int(self.down_payment_invoice_id))]).unlink()
# self.down_payment_invoice_id=False
# if self.balance_invoice_id:
# self.env['account.move'].search([('id','=',int(self.balance_invoice_id))]).unlink()
# self.balance_invoice_id=False
#suppression des dons existants
self.env['donation.donation'].search([('id','in',self.donation_ids)]).unlink()
self.donation_ids=False
if id_registration:reg=self.env['event.registration'].search([('id','=',int(id_registration))])
else : reg=self
event=self.env['event.event'].search([('id','=',int(reg.event_id))])
selected_registrant_options=self.env['event.registration_option'].search([
('event_registration_id','=',int(reg.id))])
#controles avant traitement : un produit doit être associé à l'événement
if not event.booking_product_id: raise Warning('product missing for event booking')
#Prix à appliquer au produit en fonction du statut de l'inscrit
status=reg.partner_id.member_status
product_price=event.booking_price
if status=='not member':product_price=event.booking_price
if status=='member':product_price=event.booking_member_price
if status=='super member':product_price=event.booking_super_member_price
#Prix à appliquer au produit si paiement de l'adhésion
membership_option=False
membership_product=self.env['event.membership_product'].search([])
if membership_product:
if selected_registrant_options:
for opt in selected_registrant_options:
if opt.booking_option_id==membership_product.id:
membership_option=True
if status!="super member":
product_price=event.booking_member_price
#calcul du montant total à régler
#création du devis sans accompte
if not reg.down_payment:
#création de la facture
vals={}
vals['partner_id']=int(reg.partner_id)
vals['invoice_date']=datetime.now()
#mode de paiement CB par defaut
electronic_method=self.env['account.payment.method'].search([('code','=','electronic')],limit=1)
if electronic_method:
cb_mode=self.env['account.payment.mode'].search([('payment_method_id','=',int(electronic_method.id))],limit=1)
if cb_mode:
vals['payment_mode_id']=cb_mode.id
else:
raise Warning('please configure credit card mode')
vals['move_type']='out_invoice'
vals['state']='draft'
#vals['currency_id']=self.currency_id.id
invoice=self.env['account.move'].create(vals)
invoice.state='posted'
invoice.name='REC'+str(invoice.id)
invoice.payment_reference=invoice.name
vals={}
account_credit=self.env['account.account'].search([('code','=','707100')])
account_debit=self.env['account.account'].search([('code','=','411100')])
vals['move_id']=invoice.id
vals['product_id']=int(event.booking_product_id)
vals['quantity']=1
vals['price_unit']=product_price
vals['name']=event.booking_product_id.name
vals['account_id']=int(account_credit.id)
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals)
# #debit_line
vals_d={}
vals_d['move_id']=invoice.id
vals_d['debit']=product_price
vals_d['credit']=0
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['account_id']=int(account_debit.id)
vals_d['quantity']=1
vals_d['price_unit']=product_price
vals_d['exclude_from_invoice_tab']=True
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals_d)
l=self.env['account.move.line'].search([('move_id','=',invoice.id),('balance','<',0)])
l.partner_id=int(reg.partner_id)
#ajout des options
if selected_registrant_options:
for option in selected_registrant_options:
prd=self.env['product.product'].search([('id','=',int(option.booking_option_id.id))])
#prix à appliquer aux options en fonction du statut ou de la présence de l'option d'adhesion
event_option=self.env['booking.option'].search(['&',('event_id','=',int(reg.event_id)),('booking_option_id','=',int(option.booking_option_id.id))])
if event_option:
if status=="super member":price_unit=event_option.booking_option_super_member_price
if status=="member":price_unit=event_option.booking_option_member_price
if status=="not member" and membership_option:price_unit=event_option.booking_option_member_price
if status=="not member" and not membership_option:price_unit=event_option.booking_option_price
vals={}
vals['move_id']=invoice.id
#ajout du produit
vals['product_id']=int(event.booking_product_id)
vals['quantity']=1
vals['price_unit']=price_unit
vals['name']=prd.name
vals['account_id']=int(account_credit.id)
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals)
#debit_line
vals_d={}
vals_d['move_id']=invoice.id
vals_d['debit']=price_unit
vals_d['credit']=0
vals_d['date']=datetime.now()
vals_d['partner_id']=int(reg.partner_id)
vals_d['product_id']=int(option.booking_option_id.id)
vals_d['name']=prd.name
vals_d['account_id']=int(account_debit.id)
vals_d['quantity']=1
vals_d['price_unit']=price_unit
vals_d['exclude_from_invoice_tab']=True
invoice_line=self.env['account.move.line'].with_context(check_move_validity=True).create([vals_d])
l=self.env['account.move.line'].search([('move_id','=',invoice.id),('balance','<',0)])
l.partner_id=int(reg.partner_id)
#si l'option est un produit de don on créé un don pour la personne
if prd.donation: self.create_donation(reg.id,reg.partner_id,vals['product_id'],vals['price_unit'])
reg.invoice_id=invoice.id
return invoice
#2 factures si paiement avec acompte
else:
#création de la 1ère facture d'acompte
vals={}
vals['partner_id']=int(reg.partner_id)
vals['invoice_date']=datetime.now()
#mode de paiement CB par defaut
electronic_method=self.env['account.payment.method'].search([('code','=','electronic')],limit=1)
if electronic_method:
cb_mode=self.env['account.payment.mode'].search([('payment_method_id','=',int(electronic_method.id))],limit=1)
if cb_mode:
vals['payment_mode_id']=cb_mode.id
else:
raise Warning('please configure credit card mode')
vals['move_type']='out_invoice'
vals['state']='draft'
#vals['currency_id']=self.currency_id.id
invoice=self.env['account.move'].create(vals)
invoice.state='posted'
invoice.name='REC'+str(invoice.id)
invoice.payment_reference=invoice.name
vals={}
account_credit=self.env['account.account'].search([('code','=','707100')])
account_debit=self.env['account.account'].search([('code','=','411100')])
vals['move_id']=invoice.id
vals['product_id']=int(event.booking_product_id)
vals['quantity']=1
vals['price_unit']=event.booking_down_payment
vals['name']='Acompte '+event.booking_product_id.name
vals['account_id']=int(account_credit.id)
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals)
# #debit_line
vals_d={}
vals_d['move_id']=invoice.id
vals_d['debit']=event.booking_down_payment
vals_d['credit']=0
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']='Acompte '+event.booking_product_id.name
vals_d['account_id']=int(account_debit.id)
vals_d['quantity']=1
vals_d['price_unit']=event.booking_down_payment
vals_d['exclude_from_invoice_tab']=True
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals_d)
l=self.env['account.move.line'].search([('move_id','=',invoice.id),('balance','<',0)])
l.partner_id=int(reg.partner_id)
reg.down_payment_invoice_id=invoice.id
#création 2ème facture de solde + paiement des options
vals={}
vals['partner_id']=int(reg.partner_id)
vals['invoice_date']=datetime.now()
vals['move_type']='out_invoice'
vals['state']='draft'
#vals['currency_id']=self.currency_id.id
invoice=self.env['account.move'].create(vals)
invoice.state='posted'
invoice.name='REC'+str(invoice.id)
invoice.payment_reference=invoice.name
vals={}
vals['move_id']=invoice.id
vals['product_id']=int(event.booking_product_id)
vals['quantity']=1
vals['price_unit']=product_price-event.booking_down_payment
vals['name']='solde '+event.booking_product_id.name
vals['account_id']=int(account_credit.id)
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals)
# #debit_line
vals_d={}
vals_d['move_id']=invoice.id
vals_d['debit']=product_price-event.booking_down_payment
vals_d['credit']=0
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['account_id']=int(account_debit.id)
vals_d['quantity']=1
vals_d['price_unit']=product_price-event.booking_down_payment
vals_d['exclude_from_invoice_tab']=True
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals_d)
l=self.env['account.move.line'].search([('move_id','=',invoice.id),('balance','<',0)])
l.partner_id=int(reg.partner_id)
#ajout des options
if selected_registrant_options:
for option in selected_registrant_options:
prd=self.env['product.product'].search([('id','=',int(option.booking_option_id.id))])
#prix à appliquer aux options en fonction du statut ou de la présence de l'option d'adhesion
event_option=self.env['booking.option'].search(['&',('event_id','=',int(reg.event_id)),('booking_option_id','=',int(option.booking_option_id.id))])
if event_option:
if status=="super member":price_unit=event_option.booking_option_super_member_price
if status=="member":price_unit=event_option.booking_option_member_price
if status=="not member" and membership_option:price_unit=event_option.booking_option_member_price
if status=="not member" and not membership_option:price_unit=event_option.booking_option_price
vals={}
vals['move_id']=invoice.id
#ajout du produit
vals['product_id']=int(event.booking_product_id)
vals['quantity']=1
vals['price_unit']=price_unit
vals['name']=prd.name
vals['account_id']=int(account_credit.id)
invoice_line=self.env['account.move.line'].with_context(check_move_validity=False).create(vals)
#debit_line
vals_d={}
vals_d['move_id']=invoice.id
vals_d['debit']=price_unit
vals_d['credit']=0
vals_d['date']=datetime.now()
vals_d['partner_id']=int(reg.partner_id)
vals_d['product_id']=int(option.booking_option_id.id)
vals_d['name']=prd.name
vals_d['account_id']=int(account_debit.id)
vals_d['quantity']=1
vals_d['price_unit']=price_unit
vals_d['exclude_from_invoice_tab']=True
invoice_line=self.env['account.move.line'].with_context(check_move_validity=True).create([vals_d])
l=self.env['account.move.line'].search([('move_id','=',invoice.id),('balance','<',0)])
l.partner_id=int(reg.partner_id)
#si l'option est un produit de don on créé un don pour la personne
if prd.donation: self.create_donation(reg.id,reg.partner_id,vals['product_id'],vals['price_unit'])
reg.balance_invoice_id=invoice.id
return invoice.id
def info_objet(self,model_id,objet_id):
field_list=request.env[model_id].sudo().fields_get()
result=[]
for key in field_list:
result.append((key,key))
result.sort()
return result
def create_payment(self,invoice_id,code_payment_method):
invoice=self.env['account.move'].search([('id','=',int(invoice_id))])
payment_method=self.env['account.payment.method'].search([('code','=',code_payment_method),('payment_type','=','inbound')])
bank=self.env['account.journal'].search([('type','=','bank')])
if not payment_method : raise Warning ('please set up the '+code_payment_method+ ' method')
if not bank : raise Warning ('please set up the bank journal !')
Payment = self.env['account.payment'].with_context(default_invoice_ids=[(4, invoice_id, False)])
payment = Payment.create({
'date': datetime.now(),
'payment_method_id': payment_method.id,
'payment_type': 'inbound',
'partner_type': 'customer',
'partner_id': invoice.partner_id.id,
'amount': invoice.amount_residual,
'journal_id': int(bank.id),
'company_id': self.env.company,
'currency_id': int(self.currency_id)
#'payment_difference_handling': 'reconcile',
#'writeoff_account_id': self.diff_income_account.id,
})
payment.state='posted'
invoice.payment_id=payment.id
invoice.payment_order_ok=True
@ -363,8 +744,9 @@ class EventRegistration_questionnaire(models.Model):
_name = 'event.registration_option'
_description = 'event registration option'
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="[('id','in',selectable_option_ids)]")
booking_option_price=fields.Monetary('Price',currency_field='currency_id',readonly=True)
selectable_option_ids = fields.Many2many('product.product', compute='_compute_selectable_option')
event_registration_id=fields.Many2one(
'event.registration',
String='Event registration',
@ -373,7 +755,11 @@ class EventRegistration_questionnaire(models.Model):
track_visibility='onchange',
)
def _compute_selectable_option(self):
selectable_options=self.env['booking.option'].search([('event_id','=',int(self.event_registration_id.event_id))])
if selectable_options:
self.selectable_option_ids=selectable_options.booking_option_id.ids
@api.model
def _default_currency(self):


+ 7
- 0
models/event.py View File

@ -45,6 +45,13 @@ class KalachakraEvent(models.Model):
online_link=fields.Char('link')
online_id=fields.Char('id')
online_password=fields.Char('password')
duration=fields.Integer('duration', compute="_compute_duration")
def _compute_duration(self):
for rec in self:
duration = rec.date_end-rec.date_begin
rec.duration = duration.days
booking_event = fields.Boolean(string="Booking event", tracking=True)
question_ids=fields.One2many(


+ 1
- 1
models/partner.py View File

@ -69,7 +69,7 @@ class partner(models.Model):
if rec.super_member: rec.member_status='super member'
member_status=fields.Selection(string='member status',selection=[('not member','Not member'),('member','Member'),('super member','Super member')]
,compute="_compute_member_status", sotre=True)
,compute="_compute_member_status")
super_member=fields.Boolean("Super member")


+ 3
- 1
models/product.py View File

@ -5,9 +5,11 @@ from psycopg2 import sql, DatabaseError
from werkzeug import utils
class ProductTemplate(models.Model):
class KalachakraProductTemplate(models.Model):
_inherit = "product.template"
membership_product = fields.Boolean(string="membership product", tracking=True)
super_membership_product = fields.Boolean(string="super membership product", tracking=True)
booking_product = fields.Boolean(string="booking product", tracking=True)
booking_option_product = fields.Boolean(string="booking option product", tracking=True)

+ 11
- 4
views/booking_event_registration.xml View File

@ -82,17 +82,22 @@
</xpath>
<xpath expr="//button[@name='action_cancel']" position="after">
<button name="action_event_registration_generate_order" type="object"
<!-- <button name="action_event_registration_generate_order" type="object"
states="open" string="Generate quotation(s)">
</button> -->
<button name="action_event_registration_generate_invoice" type="object"
states="open" string="Generate invoice(s)">
</button>
</xpath>
<xpath expr="//group[@name='event']" position="after">
<group string="Payments" name="payments">
<field name="order_id"/>
<field name="down_payment_order_id"/>
<field name="balance_order_id"/>
<field name="invoice_id"/>
<field name="down_payment_invoice_id"/>
<field name="balance_invoice_id"/>
</group>
</xpath>
@ -121,6 +126,8 @@
<tree editable="bottom">
<field name="booking_option_id"/>
<field name="selectable_option_ids" invisible="1"/>
<!-- <field name="booking_option_price"/> -->
</tree>


+ 2
- 2
views/booking_event_templates_list.xml View File

@ -21,12 +21,12 @@
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'date_only': 'true', 'format': 'long'}"/> -
</t>
<t t-if="not event.booking_event">
<time itemprop="startDate" t-att-datetime="event.date_begin">
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'date_only': 'true', 'format': 'long'}"/> -
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'time_only': 'true', 'format': 'short'}"/>
</time>
</t>
</xpath>
</template>

+ 4
- 4
views/booking_website_registration.xml View File

@ -9,7 +9,7 @@
</template>
<template id="registration_options_form" name="Registration options form">
<template id="booking_registration_options_form" name="Registration options form">
<t t-call="website.layout">
@ -171,7 +171,7 @@
</template>
<template id="registration_questionnaire_form" name="Registration questionnaire form">
<template id="booking_registration_questionnaire_form" name="Registration questionnaire form">
<t t-call="website.layout">
@ -275,7 +275,7 @@
</t>
</template>
<template id="payment_choice_form" name="payment choice form">
<template id="booking_payment_choice_form" name="payment choice form">
<t t-call="website.layout">
<div class="container-fluid">
@ -304,7 +304,7 @@
</t>
</template>
<template id="thankyou" name="booking form">
<template id="booking_thankyou" name="booking form">
<t t-call="website.layout">


+ 4
- 4
views/event.xml View File

@ -54,10 +54,10 @@
<page string="Subscriptions" name="Subscriptions" attrs="{'invisible':['|',('free_participation','=',True),('booking_event','=',True)]}">
<group style="width:40%%">
<field name="subscription_product_id" attrs="{'required': [('recurring_event','=', False)]}"/>
<field name="subscription_standard_price" attrs="{'required': [('recurring_event','=', False)]}"/>
<field name="subscription_member_price" attrs="{'required': [('recurring_event','=', False)]}"/>
<field name="subscription_super_member_price" attrs="{'required': [('recurring_event','=', False)]}"/>
<field name="subscription_product_id"/>
<field name="subscription_standard_price"/>
<field name="subscription_member_price"/>
<field name="subscription_super_member_price"/>
</group>
</page>


+ 56
- 12
views/event_templates_list.xml View File

@ -51,26 +51,70 @@
<template id="kalachakra.events_list" inherit_id="website_event.events_list">
<xpath expr="//time[@itemprop='startDate']" position="after">
<t t-if="not event.free_participation">
<t t-if="event.booking_event">
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
</time>
<br/>
<h7><font style="color: rgb(255, 0, 0)">Not member : <span t-esc="int(event.participation_standard_price)"/></font></h7>
<h7><font style="color: rgb(255, 0, 0)"> Member : <span t-esc="int(event.participation_member_price)"/></font></h7>
<h7><font style="color: rgb(255, 0, 0);">Super member : <span t-esc="int(event.participation_super_member_price)"/></font></h7>
<font style="color: rgb(255, 0, 0); font-size: 14px;">Non adhérent : <span t-esc="int(event.booking_price)"/></font>
<font style="color: rgb(255, 0, 0); font-size: 14px;"> Adhérent : <span t-esc="int(event.booking_member_price)"/></font>
<br/><font style="color: rgb(255, 0, 0); font-size: 14px;">Soutien : <span t-esc="int(event.booking_super_member_price)"/></font>
</t>
<t t-if="event.free_participation">
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
</time>
<br/>
<h7><b><font style="color: rgb(255, 0, 0)">Free participation</font></b></h7>
<t t-if="not event.booking_event">
<t t-if="not event.free_participation">
<t t-if="event.duration==0">
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
</time>
</t>
<t t-if="event.duration>0">
<br></br>
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
</time>
</t>
<br/>
<h7><font style="color: rgb(255, 0, 0);font-size: 14px;">Non adhérent : <span t-esc="int(event.participation_standard_price)"/></font></h7>
<h7><font style="color: rgb(255, 0, 0);font-size: 14px;">Adhérent : <span t-esc="int(event.participation_member_price)"/></font></h7>
<br/><h7><font style="color: rgb(255, 0, 0);font-size: 14px;">Soutien : <span t-esc="int(event.participation_super_member_price)"/></font></h7>
</t>
<t t-if="event.free_participation">
<t t-if="event.duration==0">
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
</time>
</t>
<t t-if="event.duration>0">
<br></br>
<time itemprop="endDate" t-att-datetime="event.date_end">
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'date_only': 'true', 'format': 'long'}"/>
<span t-field="event.with_context(tz=event.date_tz).date_end" t-options="{'time_only': 'true', 'format': 'short'}"/>
</time>
</t>
<br/>
<h7><font style="color: rgb(255, 0, 0);font-size: 14px;">Participation libre</font></h7>
</t>
</t>
</xpath>
</template>


+ 1
- 1
views/product.xml View File

@ -1,5 +1,5 @@
<odoo>
<record id="product_template_form_view" model="ir.ui.view">
<record id="kalachakra_product_template_form_view" model="ir.ui.view">
<field name="name">kalachakra.product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />


+ 87
- 47
views/website_event_registration.xml View File

@ -4,47 +4,64 @@
<t t-call="website.layout">
<div class="container-fluid">
<h4 style="display: inline">Registering to : </h4><h4 style="display: inline" t-esc="event.name"></h4>
<h6>From <span t-field="event.date_begin" t-options='{"format": "dd/mm/yyyy hh:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> </h6>
<h6> Your status : <span id="your_status" t-esc='status'></span></h6>
<br>
</br>
<b><h7 style="display: inline">Registering to : </h7><h7 style="display: inline" t-esc="event.name"></h7></b>
<br></br>
<t t-if="event.duration==0">
<h7>From <span t-field="event.date_begin" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "hh:mm"}'/> </h7>
</t>
<t t-if="event.duration>0">
<h7>From <span t-field="event.date_begin" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> </h7>
</t>
<br></br>
<h7> Your status :
<span t-if="status=='standard'" id="your_status">Non adhérent</span>
<span t-if="status=='member'" id="your_status">Adhérent</span>
<span t-if="status=='super member'" id="your_status">Adhérent de soutien</span>
</h7>
<br></br>
<form action="step2" method="post" class="form js_website_submit_form">
<div class="form-group s_website_form_field col-12 s_website_form_custom " data-type="selection" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class=" col-sm-auto s_website_form_label " style="width: 200px" for="2bp1hybvcoe">
<span class="s_website_form_label_content"></span>
</label>
<div class="col-sm">
<div class="row s_col_no_resize s_col_no_bgcolor s_website_form_multiple" data-display="vertical">
<div class="radio col-12">
<div class="form-check">
<input type="radio" checked="checked" class="s_website_form_input form-check-input" id="check1" name="online" value="no"/>
<label class="form-check-label s_website_form_check_label" for="check1">
Je participerai au centre Kalachakra
</label>
<div class="radio col-12">
<div class="form-check">
<input type="radio" checked="checked" class="s_website_form_input form-check-input" id="check1" name="online" value="no"/>
<label class="form-check-label s_website_form_check_label" for="check1">Je participerai au centre Kalachakra
</label>
</div>
</div>
</div>
<div class="radio col-12">
<div class="form-check">
<input type="radio" class="s_website_form_input form-check-input" id="check2" name="online" value="yes"/>
<label class="form-check-label s_website_form_check_label" for="check2">
Je participerai sur Zoom
</label>
</div>
<div class="form-check">
<input type="radio" class="s_website_form_input form-check-input" id="check2" name="online" value="yes"/>
<label class="form-check-label s_website_form_check_label" for="check2">Je participerai sur Zoom
</label>
</div>
</div>
<div class="radio col-12">
<div class="form-check">
<input type="radio" class="s_website_form_input form-check-input" id="check3" name="online" value=""/>
<label class="form-check-label s_website_form_check_label" for="check3">
Je choisirai plus tard
</label>
</div>
<div class="form-check">
<input type="radio" class="s_website_form_input form-check-input" id="check3" name="online" value=""/>
<label class="form-check-label s_website_form_check_label" for="check3">Je choisirai plus tard
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<br></br>
<br></br>
<button id="back_button1" type="button" class="btn btn-warning" >back</button>
<button type="submit" class="btn btn-primary" >Continue</button>
<br></br>
<br></br>
</form>
</div>
@ -59,16 +76,29 @@
<div class="container-fluid">
<b><h7 style="display: inline">Registering to : </h7><h7 style="display: inline" t-esc="event.name"></h7></b>
<br></br>
<h7>From <span t-field="event.date_begin" t-options='{"format": "dd/mm/yyyy hh:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> </h7>
<t t-if="event.duration==0">
<h7>From <span t-field="event.date_begin" t-options='{"format": "dd/MM/yyyy hh:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "hh:mm"}'/> </h7>
</t>
<t t-if="event.duration>0">
<h7>From <span t-field="event.date_begin" t-options='{"format": "dd/MM/yyyy HH:mm"}'/> to <span t-field="event.date_end" t-options='{"format": "dd/MM/yyyy HH:mm"}'/> </h7>
</t>
<br></br>
<h7> Your status : <span id="your_status" t-esc='status'></span></h7>
<br></br>
<h7> Your status :
<span t-if="status=='standard'" id="your_status">Non adhérent</span>
<span t-if="status=='member'" id="your_status">Adhérent</span>
<span t-if="status=='super member'" id="your_status">Adhérent de soutien</span>
</h7>
<br></br>
<br></br>
<h7>your registration is taken into account !</h7>
<br></br>
<h7>You will soon receive a confirmation email.</h7>
<br></br>
<br></br>
<t t-if="event.online_event">
<t t-if="online=='yes'">
<font color="blue">
<h7>Here is the information to attend on Zoom :</h7>
<br></br>
<ul>
@ -76,8 +106,10 @@
<li>id : <span t-esc="event.online_id"></span></li>
<li>password : <span t-esc="event.online_password"></span></li>
</ul>
</font>
<br></br>
<br></br>
</t>
</t>
@ -103,25 +135,30 @@
</t>
</t>
<t t-if="not event.free_participation">
<button type="submit" class="btn btn-primary" >I pay the participation now</button>
<br></br>
<t t-if="status in ('standard','member')">
<h7> The amount of the contribution is : </h7><b><h7 t-esc="participation_amount"></h7><h7></h7></b>
<br></br>
<button type="submit" class="btn btn-primary" >I will pay the participation on the spot</button>
<br></br>
<br></br>
<t t-if="status=='standard'">
<h7>If you want to be a member, click here : </h7><button type="submit" class="btn btn-primary" >Become a member</button>
<br></br>
<br></br>
</t>
<t t-if="status=='member'">
<h7>If you want to be a super member, click here : </h7><button type="submit" class="btn btn-primary" >Become a super member</button>
<br></br>
<br></br>
</t>
<button type="submit" class="btn btn-primary" >I pay the participation now</button>
<br></br>
<br></br>
<button type="submit" class="btn btn-primary" >I will pay the participation on the spot</button>
<br></br>
<br></br>
<t t-if="status=='standard'">
<h7>If you want to be a member, click here : </h7><button type="submit" class="btn btn-primary" >Become a member</button>
<br></br>
<br></br>
</t>
<t t-if="status=='member'">
<h7>If you want to be a super member, click here : </h7><button type="submit" class="btn btn-primary" >Become a super member</button>
<br></br>
<br></br>
</t>
</t>
</t>
<br></br>
<t t-if="status in ('standard')">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class=" col-sm-auto s_website_form_label " for="pm84usjk8cf">
<span class="s_website_form_label_content">To stay informed I subscribe to the newsletter of the center</span>
@ -130,6 +167,9 @@
<input type="checkbox" value="Yes" checked="checked" class="s_website_form_input" name="newsletter" required="1" id="pm84usjk8cf"/>
</div>
</div>
</t>
<br></br>
<br></br>
</div>
</t>


+ 16
- 7
views/website_participation.xml View File

@ -1,6 +1,6 @@
<odoo>
<template id="assets_frontend" name="booking assets" inherit_id="web.assets_frontend">
<template id="kalachakra_assets_frontend" name="booking assets" inherit_id="web.assets_frontend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/kalachakra/static/js/kalachakra.js"></script>
@ -14,8 +14,14 @@
<t t-call="website.layout">
<div class="container-fluid">
<form id="form" action="payment_choice" method="post" class="form js_website_submit_form">
<h3 t-esc="title" class="o_page_header mt16 mb4"></h3>
<form id="form" action="payment_choice" method="post" class="form js_website_submit_form">
<t t-if="title=='make donation'">
<h6 class="mt16 mb4">Make donation :</h6>
</t>
<t t-if="title=='Become a member'">
<h6 class="o_page_header mt16 mb4">Become a member :</h6>
</t>
<div id="div_email" class="form-group col-lg-4">
<label class="col-form-label font-weight-bold" for="email">Email
<span class="s_website_form_mark"> *</span>
@ -126,22 +132,23 @@
<button id="btn_payment_choice" name="o_payment_submit_button" type="button" class="btn btn-primary btn-lg mb8 mt8" data-icon-class="fa-gift">
<button id="btn_payment_choice" name="o_payment_submit_button" type="button" class="btn btn-primary" data-icon-class="fa-gift">
Payment choice
</button>
<br></br>
<br></br>
</form>
</div>
</t>
</template>
<template id="kalachakra.payment_choice_form" name="payment choice form">
<template id="kalachakra_payment_choice_form" name="payment choice form">
<t t-call="website.layout">
<div class="container-fluid">
<div id="payment_method" class="mt-3 col-lg-6">
<h4 class="mb24">Pay with </h4>
<h6 class="mb24">Pay with </h6>
<t t-call="payment.payment_tokens_list">
<t t-set="mode" t-value="'payment'"/>
<t t-set="submit_txt" t-value="submit_txt"/>
@ -161,6 +168,8 @@
<t t-set="back_button_link" t-value="'/shop/cart'"/>
</t>
</div>
<br>
</br>
</div>
</t>
</template>


Loading…
Cancel
Save