diff --git a/sao/src/tab.js b/sao/src/tab.js index 038c0185de..3711eee130 100644 --- a/sao/src/tab.js +++ b/sao/src/tab.js @@ -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() { diff --git a/tryton/tryton/gui/window/form.py b/tryton/tryton/gui/window/form.py index 63ba093f6d..8036ca5318 100644 --- a/tryton/tryton/gui/window/form.py +++ b/tryton/tryton/gui/window/form.py @@ -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