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.
13 lines
387 B
Python
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()
|