Switch the view when user cancel the new record

Closes #14583
(grafted from 86b3db529010f8fa36dfee4949f160f77298efc3)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2026-02-05 18:21:05 +01:00
1 parent 8dc49b6359
commit 5c3be297b9
2 files changed
+5 -2

No files matched your search

+3 -1
View File
@@ -856,7 +856,9 @@
});
},
switch_: function() {
return this.modified_save().then(() => this.screen.switch_view());
return this.modified_save().then(
() => this.screen.switch_view(),
(result) => result ? this.screen.switch_view() : null);
},
reload: function(test_modified=true) {
const reload = () => {
+2 -1
View File
@@ -292,7 +292,8 @@ class Form(TabContent):
update('note', label, 'tryton-note', badge)
def sig_switch(self, widget=None):
if not self.modified_save():
result = self.modified_save()
if not result and result is not None:
return
self.screen.switch_view()