summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-12-07 14:03:13 +0100
committerqsm-odoo <qsm@odoo.com>2017-02-14 16:32:15 +0100
commit7751c1bfb92f4e747ddade50f6091cf998c3fe7d (patch)
treeaf5af540ea145d35be9c73a5fd26cc5d8831634d /addons/website/static/src/js/website.editor.js
parentab78680d58712c6d03b9ac3442f00ac25a6c1f0d (diff)
[REF] web_editor, website: split customize_template_get
Commit a2ae219d4ee283b7e7af84a3e7fa3bb8e0a95f23 fixed the customize_template_get function(s) which had been modified for the 10.0 web_studio release. While the fix also reorganized the structure to make it more efficient and understandable, it promised that the function would be refactored in master. This is what this commit does. The customize_template_get route of the website module was also removed with commit 5a030db3eb77b6d80187f8ae1a64303b2f50391d as it was an useless duplicate of the web_editor customize_template_get route. The old route handled two totally different features of odoo: getting all the page-related views to allow their edition with the HTML editor and getting the "toggable views" which appear in the "Customize" website menu. The parameter "full" allowed to determine which one the route was supposed to do and was useless until website was installed to add its feature (by extending the route behavior). In both cases, views informations are returned, only the number of views differs. The above-mentionned fix already did part of the refactoring by returning the same info structure for each view in both cases. Now, the function has been split. The web_editor customize_template_get route is renamed as get_assets_editor_resources and returns the info the HTML editor needs to work (the "assets" term is in prevision of the new LESS editor). A new website route "get_switchable_related_views" has been created to return the info the "Customize" website menu needs. Both use the renamed ir.ui.view function "get_related_views" (old ir.ui.view customize_template_get function) which now returns a recordset and not a list of dictionnaries.
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 9e4e32cd227..1b302b9ea2a 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -70,9 +70,8 @@ website.TopBarCustomize = Widget.extend({
},
load_menu: function () {
var $menu = this.$el.children("ul");
- ajax.jsonRpc('/web_editor/customize_template_get', 'call', {
+ ajax.jsonRpc('/website/get_switchable_related_views', 'call', {
key: this.view_name,
- full: false
}).then(function (result) {
var current_group = "";
_.each(result, function (item) {