From 5147006384cf1fa2e64f813de490ff54f8eeb3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 28 Oct 2025 17:19:38 +0100 Subject: [PATCH] Remove the first view_ids when opening the Many2One target from tree view Closes #14328 (grafted from a157b66bb2d4b8c7e475c22247a4edd84ce12c10) --HG-- branch : 6.0 --- tryton/tryton/gui/window/view_form/view/list_gtk/widget.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py b/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py index 2850e8b585..1c8c79d265 100644 --- a/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py +++ b/tryton/tryton/gui/window/view_form/view/list_gtk/widget.py @@ -877,11 +877,13 @@ class M2O(GenericText): return target_id = self.id_from_value(field.get(record)) + # Remove first tree view as mode is form only + view_ids = self.attrs.get('view_ids', '').split(',')[1:] breadcrumb = list(self.view.screen.breadcrumb) breadcrumb.append( field.attrs.get('string') or common.MODELNAME.get(model)) screen = Screen(model, domain=domain, context=context, - mode=['form'], view_ids=self.attrs.get('view_ids', '').split(','), + mode=['form'], view_ids=view_ids, exclude_field=field.attrs.get('relation_field'), breadcrumb=breadcrumb)