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
This commit is contained in:
Cédric Krier committed 2026-02-04 15:26:34 +01:00
1 parent 66f16467d6
commit 6eff01b06a
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -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
+1 -1
View File
@@ -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())