Browse Source

attachments

dev-rcn
root 3 years ago
parent
commit
4138f8c386
6 changed files with 35 additions and 10 deletions
  1. +1
    -0
      __manifest__.py
  2. +5
    -4
      controllers/booking.py
  3. +2
    -0
      models/booking_event_registration.py
  4. +4
    -1
      static/js/booking.js
  5. +16
    -5
      views/booking_website_registration.xml
  6. +7
    -0
      views/ir.attachment.xml

+ 1
- 0
__manifest__.py View File

@ -55,6 +55,7 @@
'views/booking_room.xml',
'views/booking_questionnaire.xml',
'views/mailing_list.xml',
'views/ir.attachment.xml',
],


+ 5
- 4
controllers/booking.py View File

@ -75,7 +75,7 @@ class booking(WebsiteEventController,AuthSignupHome):
data['questions']=event.question_ids
request.session['invoice_id']=False
return http.request.render('kalachakra.booking_registration_options_form',data)
@http.route(['/booking/registration/questionnaire'], type='http', auth='user', website=True, sitemap=False,csrf=False)
@ -85,9 +85,10 @@ class booking(WebsiteEventController,AuthSignupHome):
#gestion du retour page précédente depuis page de paiement : on supprime les éléments générés ( don , adhésion)
if not post.get('nb_o'):
invoice=request.env['account.move'].sudo().search([("id","=",int(request.session['invoice_id']))])
invoice.state='draft'
invoice.unlink()
if request.session['invoice_id']:
invoice=request.env['account.move'].sudo().search([("id","=",int(request.session['invoice_id']))])
invoice.state='draft'
invoice.unlink()
return request.redirect('/booking/registration/options?event_id='+str(request.session['event_id']))
vals['event_id']=post.get('event_id')


+ 2
- 0
models/booking_event_registration.py View File

@ -250,6 +250,8 @@ class EventRegistration(models.Model):
if status!="super member":
product_price=event.booking_member_price
if self.payment_adjustement!=0:
product_price=product_price+self.payment_adjustement
#calcul du montant total à régler


+ 4
- 1
static/js/booking.js View File

@ -40,6 +40,7 @@ odoo.define('booking.main', function (require) {
$(":checkbox").change(function() {
//si coche adhésion alors le statut devient membre
if(this.value==$("#membership_product").val() && this.checked)
{
@ -47,6 +48,7 @@ odoo.define('booking.main', function (require) {
}
//si décoche adhésion alors le statut devient non membre
if(this.value==$("#membership_product").val() && this.checked==false)
{
if ($("#status").val()=='not member'){$("#status2").val('not member')}
@ -55,10 +57,11 @@ odoo.define('booking.main', function (require) {
//recalcul du prix total
if ($("#status2").val()=='not member')
{
$("#your_status").text('non adhérent')
$("#price_of_the_stay").text($("#booking_price").val()+' €')


+ 16
- 5
views/booking_website_registration.xml View File

@ -32,14 +32,23 @@
</t>
<h6>Total Price : <span id="booking_total_price"></span></h6>
<span>Do you want to pay only the deposit </span><span style="display:inline" t-esc="'('+str(int(event.booking_down_payment))+' €) ?'"/>
<div class="form-group s_website_form_field col-2 s_website_form_custom s_website_form_required" data-type="char" data-name="Field">
<select id="down_payment" name="down_payment" class="form-control s_website_form_input">
<div class="form-group s_website_form_field col- s_website_form_custom s_website_form_required " data-type="char" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
<label class="col-form-label col-sm-auto s_website_form_label" style="width: 400px">
<span class="s_website_form_label_content">Do you want to pay only the deposit </span><span style="display:inline" t-esc="'('+str(int(event.booking_down_payment))+' €) ?'"/>
</label>
<div class="col- col-sm- col-md-">
<select id="down_payment" name="down_payment" class="form-control s_website_form_input">
<option name="yes" value="true" label="Oui"></option>
<option name="no" selected="false" value="false" label="Non"></option>
</select>
</div>
</div>
</div>
<br></br>
<h6>Please select your booking options :</h6>
<br></br>
@ -52,8 +61,8 @@
<input type="hidden" id="total_price" name="total_price" t-att-value="int(price)"/>
<input type="hidden" name="event_id" t-att-value="event.id"/>
<input type="hidden" id="status" name="status" t-att-value="partner.member_status"/>
<input type="hidden" id="status2" name="status2" t-att-value="status"/>
<input type="hidden" id="status" name="status" t-att-value="status"/>
<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)"/>
<t t-if="options">
<table class='table' width='50%'>
@ -277,6 +286,8 @@
<button id="back_button2" type="button" class="btn btn-warning" >back</button>
<button type="submit" class="btn btn-primary" >Continue</button>
<br/>
<br/>
</div>
</div>
</form>


+ 7
- 0
views/ir.attachment.xml View File

@ -0,0 +1,7 @@
<odoo>
<data>
<menuitem id="ir_attachment_top_menu" sequence="17"
name="Attachments" action="base.action_attachment"/>
</data>
</odoo>

Loading…
Cancel
Save