Browse Source

corrections

dev-rcn
root 3 years ago
parent
commit
c3e3987055
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      models/event.py

+ 7
- 5
models/event.py View File

@ -3,6 +3,7 @@ from odoo import models, fields, api,_
from odoo.exceptions import UserError, ValidationError,Warning from odoo.exceptions import UserError, ValidationError,Warning
from psycopg2 import sql, DatabaseError from psycopg2 import sql, DatabaseError
from pytz import timezone from pytz import timezone
from odoo.addons.http_routing.models.ir_http import slugify
from werkzeug import utils from werkzeug import utils
@ -189,7 +190,7 @@ class KalachakraEvent(models.Model):
vals['recurring_event_newsletter_id']=int(rec.recurring_event_newsletter_id) vals['recurring_event_newsletter_id']=int(rec.recurring_event_newsletter_id)
vals['online_event']=rec.online_event vals['online_event']=rec.online_event
vals['online_link']=rec.online_link vals['online_link']=rec.online_link
vals['online_id']=int(rec.online_id)
vals['online_id']=rec.online_id
vals['online_password']=rec.online_password vals['online_password']=rec.online_password
vals['parent_event_id']=int(rec.id) vals['parent_event_id']=int(rec.id)
vals['cover_properties']=rec.cover_properties vals['cover_properties']=rec.cover_properties
@ -241,7 +242,7 @@ class KalachakraEvent(models.Model):
if prd.price_per=='day': if prd.price_per=='day':
price=option.list_price*self.duration price=option.list_price*self.duration
if prd.price_per=='night': if prd.price_per=='night':
price=option.list_price*self.duration-1
price=option.list_price*(self.duration-1)
vals['event_id']=self.id vals['event_id']=self.id
vals['booking_option_id']=option.id vals['booking_option_id']=option.id
@ -296,10 +297,11 @@ class KalachakraEvent(models.Model):
date_param=self.date_begin.strftime('%Y-%m-%d')+'-'+self.date_end.strftime('%Y-%m-%d')+'-'+str(self.id) date_param=self.date_begin.strftime('%Y-%m-%d')+'-'+self.date_end.strftime('%Y-%m-%d')+'-'+str(self.id)
else: else:
date_param=self.date_begin.strftime('%Y-%m-%d')+'-'+str(self.id) date_param=self.date_begin.strftime('%Y-%m-%d')+'-'+str(self.id)
name_param=self.name.replace(' ','-')
name_event_slug=slugify(self.name,max_length=1024, path=True)
name_param=name_event_slug.replace(' ','-')
name_param=name_param.replace('\'','-') name_param=name_param.replace('\'','-')
description='<a href="'+self.env['ir.config_parameter'].sudo().get_param('web.base.url')+'/event/'+name_param+'-'+date_param+'/register">Click here to register</a>'
description='<a href="'+self.env['ir.config_parameter'].sudo().get_param('web.base.url')+'/event/'+name_param+'-'+date_param+'/register">cliquer ici pour s\'inscrire</a>'
#str(self.date_begin.year())+'-'+str(self.date_begin.month())+'-'+self.date_begin.day() #str(self.date_begin.year())+'-'+str(self.date_begin.month())+'-'+self.date_begin.day()
body={"summary": self.name, body={"summary": self.name,


Loading…
Cancel
Save