changeset a9df34570806 in sao:5.6
details: https://hg.tryton.org/sao?cmd=changeset;node=a9df34570806
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 5f90fcd5c191 -r a9df34570806 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