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 : 6.0
This commit is contained in:
Cédric Krier
2026-02-04 15:26:34 +01:00
parent a70a7f30c2
commit d172bdf667
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -1018,10 +1018,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
+1 -1
View File
@@ -355,9 +355,9 @@ class Form(SignalEvent, 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())