Browse Source

correction

dev-rcn
root 3 years ago
parent
commit
8e435c8338
8 changed files with 47 additions and 13 deletions
  1. +1
    -1
      controllers/booking.py
  2. +1
    -1
      controllers/kalachakra.py
  3. +4
    -4
      models/booking_event_registration.py
  4. +1
    -1
      models/donation.py
  5. +12
    -1
      models/partner.py
  6. +5
    -0
      static/js/booking.js
  7. +7
    -5
      views/booking_website_registration.xml
  8. +16
    -0
      views/payment_transaction.xml

+ 1
- 1
controllers/booking.py View File

@ -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


+ 1
- 1
controllers/kalachakra.py View File

@ -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']:


+ 4
- 4
models/booking_event_registration.py View File

@ -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:


+ 1
- 1
models/donation.py View File

@ -158,4 +158,4 @@ class DonationDonation(models.Model):
return transaction
# def _generate_invoice_donation(self, vals):

+ 12
- 1
models/partner.py View File

@ -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()
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')

+ 5
- 0
static/js/booking.js View File

@ -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',


+ 7
- 5
views/booking_website_registration.xml View File

@ -41,7 +41,9 @@
<form id="form1" action="questionnaire" method="post" class="form js_website_submit_form">
<h6 style="display: inline">Registering to : </h6><h6 style="display: inline" t-esc="event.name"></h6>
<br></br>
<t t-if="not event.individual_booking_event">
<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>
</t>
<h6> Your status : <span id="your_status" t-esc='your_status'></span></h6>
<!-- <h6>Price of the stay : <span id="price_of_the_stay" t-esc="str(int(price))+ ' €'"></span></h6>
<h7>(standard price : <span t-esc="str(int(int(event.booking_price)))+ ' €'"></span>
@ -54,9 +56,8 @@
</t>
<t t-if="event.individual_booking_event">
<h6>
Les inscriptions sont acceptées sous réserve.<br></br>Nous vous conseillons, préalablement de contacter par
mail le staff du centre à <a href="mailto: info@centre-kalachakra.net"> info@centre-kalachakra.net</a> <b>pour vérifier la disponibilité et valider votre projet
de séjour en solitaire.</b>
Ce formulaire est réservé aux personnes dont le projet et les dates de retraite individuelle ont déjà été validés par la direction du centre. Pour soumettre votre demande (projet + dates souhaitées),
nous vous invitons à nous contacter par e-mail : <a href="mailto: info@centre-kalachakra.net">info@centre-kalachakra.net</a>
</h6>
<h6>Participations amounts : </h6>
<table class="table" style="width:50%">
@ -163,6 +164,7 @@ de séjour en solitaire.</b>
<input type="hidden" id="status2" name="status2" t-att-value="partner.member_status"/>
<input type="hidden" id="membership_product" name="membership_product" t-att-value="int(membership_product.id)"/>
<input type="hidden" id="individual_booking_event" name="individual_booking_event" t-att-value="individual_booking_event"/>
<input type="hidden" id="individual_day_price" name="individual_day_price" t-att-value="int(event.individual_day_price)"/>
<input type="hidden" id="individual_member_day_price" name="individual_member_day_price" t-att-value="int(event.individual_member_day_price)"/>
<input type="hidden" id="individual_super_member_day_price" name="individual_super_member_day_price" t-att-value="int(event.individual_super_member_day_price)"/>
@ -500,8 +502,8 @@ de séjour en solitaire.</b>
<t t-call="website.layout">
<div class="container-fluid">
<h6>Thank you, your request has to be confirmed by the Kalachakra Center !</h6>
<h6>You will receive an e-mail soon</h6>
<h6>Merci ! Si votre demande a été précédemment acceptée,</h6>
<h6>vous recevrez prochainement une confirmation par e-mail.</h6>
<a href="/" class="ml-4 btn btn-secondary">back Home</a>


+ 16
- 0
views/payment_transaction.xml View File

@ -1,4 +1,20 @@
<odoo>
<record id="payment_transaction_form" model="ir.ui.view">
<field name="name">kalachakra.payment.transaction.form</field>
<field name="model">payment.transaction</field>
<field name="inherit_id" ref="payment.transaction_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="invoice_ids"/>
<field name="donation_ids"/>
<field name="membership_ids"/>
</xpath>
</field>
</record>
<menuitem id="payment_transaction_top_menu" sequence="16"
name="Payment transactions" web_icon="account,static/description/icon.png"
groups="account.group_account_invoice" />


Loading…
Cancel
Save