From e1fdf944c98b9359394029b4eacddfaa6e66c3af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 5 Oct 2021 10:54:59 +0100 Subject: [PATCH] [FIX] agreement_legal: Fix JS var declaration Was causing UI errors in several parts. TT32294 --- agreement_legal/static/src/js/domain_widget_ext.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/agreement_legal/static/src/js/domain_widget_ext.js b/agreement_legal/static/src/js/domain_widget_ext.js index 9ea1af83a..032db6965 100644 --- a/agreement_legal/static/src/js/domain_widget_ext.js +++ b/agreement_legal/static/src/js/domain_widget_ext.js @@ -39,8 +39,10 @@ odoo.define("agreement_legal.domain_widget_ext", function(require) { // Create the domain selector or change the value of the current // one... - /* eslint-disable no-negated-condition */ - if (!this.domainSelector) { + var def = null; + if (this.domainSelector) { + def = this.domainSelector.setDomain(value); + } else { this.domainSelector = new DomainSelector( this, this._domainModel, @@ -52,12 +54,9 @@ odoo.define("agreement_legal.domain_widget_ext", function(require) { partialUse: this.partialUse || false, } ); - const def = this.domainSelector.prependTo(this.$el); - } else { - const def = this.domainSelector.setDomain(value); + def = this.domainSelector.prependTo(this.$el); } // ... then replace the other content (matched records, etc) - // eslint-disable-next-line no-undef return def.then(this._replaceContent.bind(this)); }, /**