diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-11-10 14:15:02 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-11-10 14:15:02 +0100 |
| commit | ebb6d1e7402e7360f84730a400983d513e0d8607 (patch) | |
| tree | a135d3b130f4dadbf721b8bbbc31c14c8d0b93f2 /addons/web/static/src/js/widgets | |
| parent | d86da5de53ab8ffc089b7d86a920e536bd65dff9 (diff) | |
| parent | 350973ff36619bec129a3dace312ec0ae561c55e (diff) | |
[MERGE] forward port branch 11.0 up to 350973ff366
Diffstat (limited to 'addons/web/static/src/js/widgets')
| -rw-r--r-- | addons/web/static/src/js/widgets/debug_manager.js | 15 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/domain_selector.js | 21 |
2 files changed, 34 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/debug_manager.js b/addons/web/static/src/js/widgets/debug_manager.js index a0edf9dba28..4160d6f554b 100644 --- a/addons/web/static/src/js/widgets/debug_manager.js +++ b/addons/web/static/src/js/widgets/debug_manager.js @@ -7,7 +7,6 @@ var config = require('web.config'); var core = require('web.core'); var Dialog = require('web.Dialog'); var field_utils = require('web.field_utils'); -var framework = require('web.framework'); var session = require('web.session'); var SystrayMenu = require('web.SystrayMenu'); var utils = require('web.utils'); @@ -190,6 +189,9 @@ var DebugManager = Widget.extend({ } }).open(); }, + /** + * Runs the JS (desktop) tests + */ perform_js_tests: function () { this.do_action({ name: _t("JS Tests"), @@ -198,6 +200,17 @@ var DebugManager = Widget.extend({ url: '/web/tests?mod=*' }); }, + /** + * Runs the JS mobile tests + */ + perform_js_mobile_tests: function () { + this.do_action({ + name: _t("JS Mobile Tests"), + target: 'new', + type: 'ir.actions.act_url', + url: '/web/tests/mobile?mod=*' + }); + }, split_assets: function() { window.location = $.param.querystring(window.location.href, 'debug=assets'); }, diff --git a/addons/web/static/src/js/widgets/domain_selector.js b/addons/web/static/src/js/widgets/domain_selector.js index 782128994db..0619cf613c6 100644 --- a/addons/web/static/src/js/widgets/domain_selector.js +++ b/addons/web/static/src/js/widgets/domain_selector.js @@ -179,7 +179,16 @@ 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.invalidDomain = true; + this.children = []; + return; + } + this._initialize(domain); }, /** * @see DomainNode.start @@ -443,6 +452,16 @@ var DomainSelector = DomainTree.extend({ domain_changed: "_onDomainChange", }), + start: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + if (self.invalidDomain) { + var msg = _t("This domain is not supported."); + self.$el.html(msg); + } + }); + }, + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- |
