From 6eff01b06aaf36b85a6977f28a5f7ba5580a3f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 4 Feb 2026 15:26:34 +0100 Subject: [PATCH] Set revision context before clearing the screen This prevents the clear method (which set the current record to null) to update the URL with the old revision and thus opens a new tab. Closes #14577 (grafted from 804f498790430d3fd89a274d5e261fb80b0c5520) --HG-- branch : 7.0 --- sao/src/tab.js | 4 +++- tryton/tryton/gui/window/form.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sao/src/tab.js b/sao/src/tab.js index 66ca9655ac..0d546ac704 100644 --- a/sao/src/tab.js +++ b/sao/src/tab.js @@ -986,10 +986,12 @@ revision = revisions[revisions.length - 1][0]; } if (revision != this.screen.context._datetime) { - this.screen.clear(); // Update group context that will be propagated by // recreating new group this.screen.group._context._datetime = revision; + // clear after updating the datetime such that the tab + // compute already the right URL + this.screen.clear(); if (this.screen.current_view.view_type != 'form') { this.screen.search_filter( this.screen.screen_container diff --git a/tryton/tryton/gui/window/form.py b/tryton/tryton/gui/window/form.py index ef00c76570..f92bd57386 100644 --- a/tryton/tryton/gui/window/form.py +++ b/tryton/tryton/gui/window/form.py @@ -324,9 +324,9 @@ class Form(TabContent): and revision < revisions[-1][0]): revision = revisions[-1][0] if revision != self.screen.context.get('_datetime'): - self.screen.clear() # Update root group context that will be propagated self.screen.group._context['_datetime'] = revision + self.screen.clear() if self.screen.current_view.view_type != 'form': self.screen.search_filter( self.screen.screen_container.get_text())