|
@ -32,15 +32,19 @@ def create_donation(self): |
|
|
class Kalachakra_PortalAccount(CustomerPortal): |
|
|
class Kalachakra_PortalAccount(CustomerPortal): |
|
|
|
|
|
|
|
|
@http.route(['/invoice_event'], type='http', auth='user', website=True, sitemap=False,csrf=False) |
|
|
@http.route(['/invoice_event'], type='http', auth='user', website=True, sitemap=False,csrf=False) |
|
|
def invoice_event(self,event_id,*args,**kw): |
|
|
|
|
|
|
|
|
def invoice_event(self,event_id,partner_id=None,*args,**kw): |
|
|
data={} |
|
|
data={} |
|
|
#contact lié à l'utilisateur |
|
|
#contact lié à l'utilisateur |
|
|
userid=request.env.context.get('uid') |
|
|
|
|
|
user=request.env['res.users'].search([('id','=',int(userid))]) |
|
|
|
|
|
partner=request.env['res.partner'].sudo().search([('id','=',int(user.partner_id))]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not partner_id : |
|
|
|
|
|
userid=request.env.context.get('uid') |
|
|
|
|
|
user=request.env['res.users'].search([('id','=',int(userid))]) |
|
|
|
|
|
partner=request.env['res.partner'].sudo().search([('id','=',int(user.partner_id))]) |
|
|
|
|
|
else: |
|
|
|
|
|
partner=request.env['res.partner'].sudo().search([('id','=',int(partner_id))]) |
|
|
|
|
|
|
|
|
#inscription |
|
|
#inscription |
|
|
reg=request.env['event.registration'].sudo().search([('event_id','=',int(event_id)),('partner_id','=',int(partner.id))]) |
|
|
|
|
|
|
|
|
reg=request.env['event.registration'].sudo().search([('event_id','=',int(event_id)),('partner_id','=',int(partner.id))],limit=1) |
|
|
|
|
|
#return str(partner.id) |
|
|
if reg: |
|
|
if reg: |
|
|
url="/my/invoices/"+str(int(reg.invoice_id)) |
|
|
url="/my/invoices/"+str(int(reg.invoice_id)) |
|
|
return request.redirect(url) |
|
|
return request.redirect(url) |
|
|