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
This commit is contained in:
Cédric Krier
2026-02-04 15:26:34 +01:00
parent ce6c415c69
commit f7f8c002b7
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -1053,10 +1053,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
@@ -354,9 +354,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())