[FIX] utm: wrap response in an odoo Response before setting cookie
Since [1] the odoo `Response.set_cookie` signature is different from the one of `werkzeug.wrappers.Response`. This commit wraps responses into odoo Responses between setting cookies. [1]: https://github.com/odoo/odoo/commit/2cbda6c98ee947cea1d06c09880eee8c758304a8 X-original-commit: 6a2675fd4d0cc2cb0e23a4b4c5aaf62a1568be50 Part-of: odoo/odoo#112827
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
from odoo.http import request, Response
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
@@ -13,6 +13,8 @@ class IrHttp(models.AbstractModel):
|
||||
|
||||
@classmethod
|
||||
def _set_utm(cls, response):
|
||||
# Make sure response is an odoo Response.
|
||||
response = Response.load(response)
|
||||
domain = cls.get_utm_domain_cookies()
|
||||
for url_parameter, __, cookie_name in request.env['utm.mixin'].tracking_fields():
|
||||
if url_parameter in request.params and request.httprequest.cookies.get(cookie_name) != request.params[url_parameter]:
|
||||
|
||||
Reference in New Issue
Block a user