Select first record when refreshing attachment preview

Since ab82d479eca1 no record is set when displaying screen.

Closes #12756
(grafted from e40c63e467b0f878b54594729c7e07458f12ad71)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2023-11-16 18:23:14 +01:00
parent 20fa476c9c
commit 2fb4da22ec
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -1309,7 +1309,13 @@
if (!Sao.common.compare(this.attachment_screen.domain, domain) ||
force) {
this.attachment_screen.domain = domain;
this.attachment_screen.search_filter();
this.attachment_screen.search_filter().then(() => {
const group = this.attachment_screen.group;
if (group.length) {
this.attachment_screen.current_record = group[0];
this.attachment_screen.display();
}
});
}
},
note: function() {
+4
View File
@@ -240,6 +240,10 @@ class Form(TabContent):
if self.attachment_screen.domain != domain or force:
self.attachment_screen.domain = domain
self.attachment_screen.search_filter()
group = self.attachment_screen.group
if group:
self.attachment_screen.current_record = group[0]
self.attachment_screen.display()
def sig_note(self, widget=None):
record = self.screen.current_record