From 2dcadb7fff33eb56bb00bb045fc090ca9e8a1080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 31 Oct 2025 18:04:31 +0100 Subject: [PATCH] Use the local context when launching a graph_open action Using the local context allow us to access the context of the field shown by the graph when the graph shows a One2Many field. Closes #14341 (grafted from f186b83936dbde32aca06b3a329bf519df2c8232) --HG-- branch : 6.0 --- sao/src/view/graph.js | 2 +- tryton/tryton/gui/window/view_form/view/graph_gtk/graph.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sao/src/view/graph.js b/sao/src/view/graph.js index e79a49aca1..70ef8dc9af 100644 --- a/sao/src/view/graph.js +++ b/sao/src/view/graph.js @@ -245,7 +245,7 @@ }, action: function(data, element) { var ids = this.ids[this._action_key(data)]; - var ctx = jQuery.extend({}, this.view.screen.group._context); + var ctx = jQuery.extend({}, this.view.screen.group.local_context); delete ctx.active_ids; delete ctx.active_id; Sao.Action.exec_keyword('graph_open', { diff --git a/tryton/tryton/gui/window/view_form/view/graph_gtk/graph.py b/tryton/tryton/gui/window/view_form/view/graph_gtk/graph.py index ede0d236cd..485ec9491e 100644 --- a/tryton/tryton/gui/window/view_form/view/graph_gtk/graph.py +++ b/tryton/tryton/gui/window/view_form/view/graph_gtk/graph.py @@ -138,7 +138,7 @@ class Graph(Gtk.DrawingArea): def action_keyword(self, ids): if not ids: return - ctx = self.group._context.copy() + ctx = self.group.local_context.copy() if 'active_ids' in ctx: del ctx['active_ids'] if 'active_id' in ctx: