From 17424bd4c8cb0fdf8a63c601633eaa9deeebb8e9 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 12 Jan 2016 16:48:46 +0100 Subject: [PATCH] [FIX] web: reload view on fail after write/create with action button Issue: Invoicing -> Vendor bills Create a record with reference=0 -> Register Payment Create a second record with reference=0, at least one line with at least one tax -> Save Edit -> change quantity in the line -> Register Payment -> the register fail change the quantity again and change reference=1 -> Register Payment The taxes is include twice --- addons/web/static/src/js/views/form_widgets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js index 96107503a5f..4d39d8df806 100644 --- a/addons/web/static/src/js/views/form_widgets.js +++ b/addons/web/static/src/js/views/form_widgets.js @@ -81,7 +81,6 @@ var WidgetButton = common.FormWidget.extend({ }, on_confirmed: function() { var self = this; - var context = this.build_context(); return this.view.do_execute_action( _.extend({}, this.node.attrs, {context: context}), @@ -89,6 +88,8 @@ var WidgetButton = common.FormWidget.extend({ if (!_.isObject(reason)) { self.view.recursive_reload(); } + }).fail(function () { + self.view.recursive_reload(); }); }, check_disable: function() {