Remove old source_id
Use hr.recruitment.source to generate link with utm and create
alias with default value for utm
[FIX] crm/utm: Fix bug with utm (ddac26cdbb)
Move demo into data
Move ir_http to save the utm in the dispatch
18 lines
613 B
Python
18 lines
613 B
Python
# -*- coding: utf-8 -*-
|
|
from openerp.http import request
|
|
from openerp.osv import orm
|
|
|
|
|
|
class ir_http(orm.AbstractModel):
|
|
_inherit = 'ir.http'
|
|
|
|
def get_utm_domain_cookies(self):
|
|
return request.httprequest.host
|
|
|
|
def _dispatch(self):
|
|
response = super(ir_http, self)._dispatch()
|
|
for var, dummy in self.pool['utm.mixin'].tracking_fields():
|
|
if var in request.params and (var not in request.session or request.session[var] != request.params[var]):
|
|
response.set_cookie(var, request.params[var], domain=self.get_utm_domain_cookies())
|
|
return response
|