Files
odoo_source/addons/website_sale/models/ir_http.py
T
Ajay javiya 418414b9c1 [IMP] website_sale : allow user to set default sale team and saleperson for ecommerce SO.
Also add 'affiliate_id' in the user session : the param contains the id of the saleperson to assign if the current user create an SO. This param is passed by the URL query param, then stored in the session.
2015-05-06 10:40:26 +02:00

13 lines
387 B
Python

# -*- coding: utf-8 -*-
from openerp import models
from openerp.addons.web.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
def _dispatch(self):
affiliate_id = request.httprequest.args.get('affiliate_id')
if affiliate_id:
request.session['affiliate_id'] = int(affiliate_id)
return super(IrHttp, self)._dispatch()