summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-22 17:20:15 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-22 17:20:15 +0200
commitd5f2a38b50ceb2fb9f5dcecb5eeaad3188555705 (patch)
tree5ad6be44887a1980ca1703f3fd80c38c10ddf1e5 /addons/web_editor/static/src/js
parente38de9dfa4c09f861253cb85643a47153d448e3c (diff)
parent6956ad54de52055910539118a34355f818e57c4a (diff)
[MERGE] forward port branch saas-14 up to 6956ad54de5
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/ace.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/ace.js b/addons/web_editor/static/src/js/ace.js
index 4a5e4a6d824..fed52c06f1d 100644
--- a/addons/web_editor/static/src/js/ace.js
+++ b/addons/web_editor/static/src/js/ace.js
@@ -204,7 +204,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";
}
}