From 241f778e22b6ab662fd8d60e5a098b7da77520a0 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 12 Jan 2017 13:29:10 +0100 Subject: [PATCH] [FIX] web: allow empty domain value with the in_dialog option The "in_dialog" option of the domain field was not working correctly when the field value was falsy as it did not consider it to be "[]" in that case (as it is done without the "in_dialog" option). Same goes for the dialog which displays the matched records. --- addons/web/static/src/js/views/form_widgets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js index 129865996f8..c445e3d6d31 100644 --- a/addons/web/static/src/js/views/form_widgets.js +++ b/addons/web/static/src/js/views/form_widgets.js @@ -509,14 +509,14 @@ var FieldDomain = common.AbstractField.extend(common.ReinitializeFieldMixin).ext return new common.SelectCreateDialog(this, { title: _t("Selected records"), res_model: this.model, - domain: this.get("value"), + domain: this.get("value") || "[]", no_create: true, readonly: true, disable_multiple_selection: true, }).open(); }, openDomainDialog: function () { - new DomainSelectorDialog(this, this.model, this.get("value"), { + new DomainSelectorDialog(this, this.model, this.get("value") || "[]", { readonly: this.get("effective_readonly"), fs_filters: this.options.fs_filters, debugMode: session.debug,