details: https://code.tryton.org/tryton/commit/8c13c204a426
branch: 6.0
user: Cédric Krier <[email protected]>
date: Thu Feb 05 18:21:05 2026 +0100
description:
Switch the view when user cancel the new record
Closes #14583
(grafted from 86b3db529010f8fa36dfee4949f160f77298efc3)
diffstat:
sao/src/tab.js | 2 ++
tryton/tryton/gui/window/form.py | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
diffs (25 lines):
diff -r 56aa903ed852 -r 8c13c204a426 sao/src/tab.js
--- a/sao/src/tab.js Wed Jan 21 19:12:34 2026 +0100
+++ b/sao/src/tab.js Thu Feb 05 18:21:05 2026 +0100
@@ -848,6 +848,8 @@
switch_: function() {
return this.modified_save().then(function() {
return this.screen.switch_view();
+ }.bind(this), function(result) {
+ return result ? this.screen.switch_view() : null;
}.bind(this));
},
reload: function(test_modified) {
diff -r 56aa903ed852 -r 8c13c204a426 tryton/tryton/gui/window/form.py
--- a/tryton/tryton/gui/window/form.py Wed Jan 21 19:12:34 2026 +0100
+++ b/tryton/tryton/gui/window/form.py Thu Feb 05 18:21:05 2026 +0100
@@ -294,7 +294,8 @@
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()