changeset c0e1f841cebc in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=c0e1f841cebc
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
diffstat:

 src/screen.js |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 36b657f715cb -r c0e1f841cebc src/screen.js
--- a/src/screen.js     Sat May 09 09:31:59 2020 +0200
+++ b/src/screen.js     Sun May 10 11:34:47 2020 +0200
@@ -1891,7 +1891,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));

Reply via email to