Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
2f181408
Commit
2f181408
authored
10 years ago
by
Jeremy Kersten
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] crm: Use cookies to save utm instead of session.
parent
b6fb02a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/crm/crm.py
+1
-1
1 addition, 1 deletion
addons/crm/crm.py
addons/crm/ir_http.py
+6
-2
6 additions, 2 deletions
addons/crm/ir_http.py
with
7 additions
and
3 deletions
addons/crm/crm.py
+
1
−
1
View file @
2f181408
...
...
@@ -82,7 +82,7 @@ class crm_tracking_mixin(osv.AbstractModel):
def
tracking_get_values
(
self
,
cr
,
uid
,
vals
,
context
=
None
):
for
key
,
field
in
self
.
tracking_fields
():
column
=
self
.
_all_columns
[
field
].
column
value
=
vals
.
get
(
field
)
or
(
request
and
request
.
session
.
get
(
key
))
# params.get should be always in session by the dispatch from ir_http
value
=
vals
.
get
(
field
)
or
(
request
and
request
.
httprequest
.
cookies
.
get
(
key
))
# params.get should be always in session by the dispatch from ir_http
if
column
.
_type
in
[
'
many2one
'
]
and
isinstance
(
value
,
basestring
):
# if we receive a string for a many2one, we search / create the id
if
value
:
Model
=
self
.
pool
[
column
.
_obj
]
...
...
This diff is collapsed.
Click to expand it.
addons/crm/ir_http.py
+
6
−
2
View file @
2f181408
...
...
@@ -6,8 +6,12 @@ from openerp.osv import orm
class
ir_http
(
orm
.
AbstractModel
):
_inherit
=
'
ir.http
'
def
get_utm_domain_cookies
(
slef
):
return
request
.
httprequest
.
host
def
_dispatch
(
self
):
response
=
super
(
ir_http
,
self
).
_dispatch
()
for
var
,
dummy
in
self
.
pool
[
'
crm.tracking.mixin
'
].
tracking_fields
():
if
var
in
request
.
params
and
(
var
not
in
request
.
session
or
request
.
session
[
var
]
!=
request
.
params
[
var
]):
request
.
session
[
var
]
=
request
.
params
[
var
]
return
super
(
ir_http
,
self
).
_dispatch
()
response
.
set_cookie
(
var
,
request
.
params
[
var
],
domain
=
self
.
get_utm_domain_cookies
())
return
response
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment