diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-08-24 13:17:53 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-08-24 13:17:53 +0200 |
| commit | 017ee5eab376b4f09beb62812c1cbc682009ed86 (patch) | |
| tree | 2af185b0604cd8ce9129c39137bbf39d21d7be89 /addons/web_editor/static | |
| parent | 006c16198f7f68c9dc8b895defd013f33008840a (diff) | |
| parent | 877e7098719195ed2934fc9c3b5c3bd8ad8bab07 (diff) | |
[MERGE] forward port branch saas-17 up to 877e7098719
Diffstat (limited to 'addons/web_editor/static')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/ace.js | 10 |
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'; } } |
