From 1a1840670db7cc83004dbcf87bff611fb6548b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Jul 2026 13:16:19 +0200 Subject: [PATCH] Include context domain in URL and tab comparison Closes #14921 (grafted from 0a37d816a7162d9aadb63ec68f63acf85c938e50) --HG-- branch : 8.0 --- sao/src/sao.js | 2 ++ sao/src/screen.js | 4 ++++ sao/src/tab.js | 3 +++ tryton/tryton/gui/main.py | 2 ++ tryton/tryton/gui/window/form.py | 2 ++ tryton/tryton/gui/window/view_form/screen/screen.py | 4 ++++ 6 files changed, 17 insertions(+) diff --git a/sao/src/sao.js b/sao/src/sao.js index 238c66bbfe..b55f9cb97f 100644 --- a/sao/src/sao.js +++ b/sao/src/sao.js @@ -529,6 +529,8 @@ var Sao = { attributes.name = loads(params.name || '""'); attributes.search_value = loads(params.search_value || '[]'); attributes.domain = loads(params.domain || '[]'); + attributes.context_domain = loads( + params.context_domain || '[]'); attributes.context = loads(params.context || '{}'); attributes.context_model = params.context_model; attributes.tab_domain = loads(params.tab_domain || '[]'); diff --git a/sao/src/screen.js b/sao/src/screen.js index 8183090e44..d6f3bcfa19 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -2168,6 +2168,10 @@ if (!jQuery.isEmptyObject(this.domain)) { query_string.push(['domain', dumps(this.domain)]); } + if (!jQuery.isEmptyObject(this.context_domain)) { + query_string.push( + ['context_domain', dumps(this.context_domain)]); + } var context = this.local_context; // Avoid rpc context if (!jQuery.isEmptyObject(context)) { query_string.push(['context', dumps(context)]); diff --git a/sao/src/tab.js b/sao/src/tab.js index 3263d4e883..8a426dd335 100644 --- a/sao/src/tab.js +++ b/sao/src/tab.js @@ -832,6 +832,9 @@ (this.attributes.res_id === attributes.res_id) && (compare( this.attributes.domain || [], attributes.domain || [])) && + (compare( + this.attributes.context_domain || [], + attributes.context_domain || [])) && (compare( this.attributes.view_ids || [], attributes.view_ids || [])) && diff --git a/tryton/tryton/gui/main.py b/tryton/tryton/gui/main.py index 0a43f1ac16..47e52c47b6 100644 --- a/tryton/tryton/gui/main.py +++ b/tryton/tryton/gui/main.py @@ -1017,6 +1017,8 @@ class Main(Gtk.Application): attributes['search_value'] = loads( params.get('search_value', '[]')) attributes['domain'] = loads(params.get('domain', '[]')) + attributes['context_domain'] = loads( + params.get('context_domain', '[]')) attributes['context'] = loads(params.get('context', '{}')) attributes['context_model'] = params.get('context_model') attributes['tab_domain'] = loads( diff --git a/tryton/tryton/gui/window/form.py b/tryton/tryton/gui/window/form.py index 005c868b61..9d3d9684ae 100644 --- a/tryton/tryton/gui/window/form.py +++ b/tryton/tryton/gui/window/form.py @@ -121,6 +121,8 @@ class Form(TabContent): and self.model == model and self.res_id == attributes.get('res_id') and self.attributes.get('domain') == attributes.get('domain') + and (self.attributes.get('context_domain') + == attributes.get('context_domain')) and self.attributes.get('view_ids') == attributes.get('view_ids') and (attributes.get('view_ids') or (self.attributes.get('mode') or ['tree', 'form']) == ( diff --git a/tryton/tryton/gui/window/view_form/screen/screen.py b/tryton/tryton/gui/window/view_form/screen/screen.py index 8d20be8f70..af7e381ca8 100644 --- a/tryton/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/tryton/gui/window/view_form/screen/screen.py @@ -1362,6 +1362,10 @@ class Screen: if self.domain: query_string.append(('domain', json.dumps( self.domain, cls=JSONEncoder, separators=(',', ':')))) + if self.context_domain: + query_string.append(('context_domain', json.dumps( + self.context_domain, cls=JSONEncoder, + separators=(',', ':')))) context = self.local_context # Avoid rpc context if context: query_string.append(('context', json.dumps(