changeset 6b921aef82dc in sao:5.2
details: https://hg.tryton.org/sao?cmd=changeset;node=6b921aef82dc
description:
Always reload record even when exception is raised
As the record is saved without reload, we must ensure to always reload
the
record even if the execution of the button fails.
issue9299
review309541002
(grafted from c0e1f841cebcd29c0cd05b0c49230fef3c4c7575)
diffstat:
src/screen.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r 6ec44c348fe1 -r 6b921aef82dc src/screen.js
--- a/src/screen.js Fri May 01 15:38:01 2020 +0200
+++ b/src/screen.js Sun May 10 11:34:47 2020 +0200
@@ -1862,7 +1862,11 @@
ids.push(record.id);
}
return record.model.execute(attributes.name,
- [ids],
context).then(process_action.bind(this));
+ [ids], context)
+ .then(process_action.bind(this))
+ .fail(function() {
+ return this.reload(ids, true);
+ }.bind(this));
}.bind(this));
}
}.bind(this));