summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
commit017ee5eab376b4f09beb62812c1cbc682009ed86 (patch)
tree2af185b0604cd8ce9129c39137bbf39d21d7be89 /addons/web_editor/static/src/js/widgets
parent006c16198f7f68c9dc8b895defd013f33008840a (diff)
parent877e7098719195ed2934fc9c3b5c3bd8ad8bab07 (diff)
[MERGE] forward port branch saas-17 up to 877e7098719
Diffstat (limited to 'addons/web_editor/static/src/js/widgets')
-rw-r--r--addons/web_editor/static/src/js/widgets/ace.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/widgets/ace.js b/addons/web_editor/static/src/js/widgets/ace.js
index cdcf5167e4a..03c767328d1 100644
--- a/addons/web_editor/static/src/js/widgets/ace.js
+++ b/addons/web_editor/static/src/js/widgets/ace.js
@@ -224,7 +224,15 @@ var ViewEditor = Widget.extend({
initType = 'less';
}
if (!this.options.doNotLoadViews) {
- initResID = (typeof this.viewKey === 'number' ? this.viewKey : _.findWhere(this.views, {xml_id: this.viewKey}).id);
+ if (typeof this.viewKey === "number") {
+ initResID = this.viewKey;
+ } else {
+ var view = _.findWhere(this.views, {xml_id: this.viewKey});
+ if (!view) {
+ view = _.findWhere(this.views, {key: this.viewKey});
+ }
+ initResID = view.id;
+ }
initType = 'xml';
}
}