diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-02-01 16:40:13 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-02-01 16:40:13 +0100 |
| commit | 920aa6174c938bbfc0864a95ff3d8ebbe3132387 (patch) | |
| tree | a1bd8f8871cba6af086607d94842a4f5e53fbbbe /addons/web/static/src/js | |
| parent | eeebd4ad857fec39c14abc0a0e387c13adcfa30b (diff) | |
| parent | e0422bfd6c528313ee399dad3e67407360d49725 (diff) | |
[MERGE] forward port branch saas-15 up to e0422bfd6c5
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/widgets/domain_selector.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/domain_selector.js b/addons/web/static/src/js/widgets/domain_selector.js index 3844c87fece..298f4f064e5 100644 --- a/addons/web/static/src/js/widgets/domain_selector.js +++ b/addons/web/static/src/js/widgets/domain_selector.js @@ -180,7 +180,17 @@ var DomainTree = DomainNode.extend({ */ init: function (parent, model, domain, options) { this._super.apply(this, arguments); - this._initialize(Domain.prototype.stringToArray(domain)); + try { + domain = Domain.prototype.stringToArray(domain); + } catch (err) { + // TODO: domain could contain `parent` for example, which is + // currently not handled by the DomainSelector + this._isValid = false; + this.children = []; + return; + } + + this._initialize(domain); }, /** * @see DomainNode.start @@ -565,6 +575,18 @@ var DomainSelector = DomainTree.extend({ this._redraw(); } }, + + start: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + if (!self._isValid) { + var msg = _t("This domain is not supported."); + self.$el.html(msg); + } + }); + }, + + }); /** |
