summaryrefslogtreecommitdiff
path: root/addons/web_editor/controllers/main.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-02-04 13:27:22 +0100
committerChristophe Simonis <chs@odoo.com>2019-02-04 13:27:22 +0100
commit4400cce8201579fc9769b5e2d33829b43bce82d9 (patch)
treec507c7dca21bfb0c3bdca8ba57e63a6ab16f230c /addons/web_editor/controllers/main.py
parentceb05489303dee728c3960a87bf23795efc374c4 (diff)
parent4524ad06a8af82ab337fc5aa1d5aa8d8d3024923 (diff)
[MERGE] forward port branch saas-12.1 up to 4524ad06a8a
Diffstat (limited to 'addons/web_editor/controllers/main.py')
-rw-r--r--addons/web_editor/controllers/main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py
index 55facfa93d1..9f6b28179db 100644
--- a/addons/web_editor/controllers/main.py
+++ b/addons/web_editor/controllers/main.py
@@ -296,6 +296,9 @@ class Web_Editor(http.Controller):
result['originalSrc'] = record.url
return result
+ def _get_view_fields_to_read(self):
+ return ['name', 'id', 'key', 'xml_id', 'arch', 'active', 'inherit_id']
+
## The get_assets_editor_resources route is in charge of transmitting the resources the assets
## editor needs to work.
## @param key - the xml_id or id of the view the resources are related to
@@ -308,7 +311,7 @@ class Web_Editor(http.Controller):
def get_assets_editor_resources(self, key, get_views=True, get_scss=True, bundles=False, bundles_restriction=[]):
# Related views must be fetched if the user wants the views and/or the style
views = request.env["ir.ui.view"].get_related_views(key, bundles=bundles)
- views = views.read(['name', 'id', 'key', 'xml_id', 'arch', 'active', 'inherit_id'])
+ views = views.read(self._get_view_fields_to_read())
scss_files_data_by_bundle = []
@@ -454,7 +457,7 @@ class Web_Editor(http.Controller):
(note: searching for the URL string is not enough as it could appear in a comment or an xpath expression.)
"""
- return bool(etree.XML(view.arch).xpath("link[@href='{}']".format(url)))
+ return bool(etree.XML(view.arch).xpath("//link[@href='{}']".format(url)))
view_to_xpath = IrUiView.get_related_views(bundle_xmlid, bundles=True).filtered(views_linking_url)