summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorrde <rde@odoo.com>2017-10-18 16:48:28 +0200
committerJeremy Kersten <jke@odoo.com>2017-10-23 14:31:07 +0200
commite19c6a5ead59c1197bc4d2cdd04d086519b1caf9 (patch)
treed57bb464e6f6c3b9705a04de2edaa6b0996a1b65 /odoo/http.py
parent7ec5f093de10c965b217714fa3f78834f0386b10 (diff)
[IMP] website: set viewid in frontend & save template for dispatch
This commit is related to enterprise commit adding crm_track option to routes. Before this commit: We could not get template's name after dispatch() had been called. Indeed, it will remove the template name from the response (response.flatten()) to make it not considered as 'qweb' anymore (is_qweb()). In some case (e.g. website_crm_score), we still need the template's name later. (Eg: to retrieve the route's view being rendered and check if trackable or not) Add view-id in template, when main_object is not an ir_ui_view, it avoid to make extra rpc to get the view_id. this commit closes #20313
Diffstat (limited to 'odoo/http.py')
-rw-r--r--odoo/http.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/odoo/http.py b/odoo/http.py
index 3da0379e551..d19190870c6 100644
--- a/odoo/http.py
+++ b/odoo/http.py
@@ -1219,6 +1219,7 @@ class Response(werkzeug.wrappers.Response):
def set_default(self, template=None, qcontext=None, uid=None):
self.template = template
self.qcontext = qcontext or dict()
+ self.qcontext['response_template'] = self.template
self.uid = uid
# Support for Cross-Origin Resource Sharing
if request.endpoint and 'cors' in request.endpoint.routing: