From e1b1491c2cbd0c5ede7859a1b59772eed989c6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 10 Dec 2023 23:32:43 +0100 Subject: [PATCH] Do not compute domain inversion when displaying column that is not a field Since c320a786923f the field is needed to compute domain inversion so we should not compute domain inversion for non field. Closes #12814 (grafted from fe581cde6705c4b2e7bad61894e0b3098ede65f3) --HG-- branch : 7.0 --- sao/src/view/tree.js | 2 +- tryton/tryton/gui/window/view_form/view/list.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index 940d87223f..df7ce45c75 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -878,7 +878,7 @@ } else if (name === this.screen.exclude_field) { visible_columns -= 1; column.set_visible(false); - } else { + } else if (name in this.screen.model.fields) { const field = this.screen.model.fields[name]; var inv_domain = inversion.domain_inversion(domain, name); if (typeof inv_domain != 'boolean') { diff --git a/tryton/tryton/gui/window/view_form/view/list.py b/tryton/tryton/gui/window/view_form/view/list.py index 4a3a1bfc2d..613bdeaa57 100644 --- a/tryton/tryton/gui/window/view_form/view/list.py +++ b/tryton/tryton/gui/window/view_form/view/list.py @@ -1131,8 +1131,8 @@ class ViewTree(View): column.set_visible(False) elif name == self.screen.exclude_field: column.set_visible(False) - else: - field = self.group.fields.get(name) + elif name in self.group.fields: + field = self.group.fields[name] inv_domain = domain_inversion(domain, name) if not isinstance(inv_domain, bool): inv_domain = simplify(inv_domain)