From 755081cbf4d3df629a33565fc4e59bb4d020ad52 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 12 Jul 2018 11:46:43 +0200 Subject: [PATCH] [FIX] account: reconciliation widget rounding Set the rounding method to Round Globally Create a tax A with rate = 1.1040 % Create a bank statement with one line having amount = 1153.960 Go on to reconcile that bank statement Reconcile with a new line on which the tax A applies Create the write-off Click on Reconcile Before this commit, an error was thrown by the server (Move unbalanced) This was because the amount of the write-off line sent by JS (which is the tax amount) was 12.7397 The server though computes the taxes by forcing the rounding and gives off a tax amount of 12.74 Hence the error After this commit, the JS will fetch the amount of the taxes by forcing the rounding there also And the reconciliation process goes well This fix is already present in v11.0 at 6fce298d7013379c4383e8368c40ee06d6146423 OPW 1859939 closes #25733 --- addons/account/static/src/js/account_reconciliation_widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js index a2b0f66d9b7..5d00984157c 100644 --- a/addons/account/static/src/js/account_reconciliation_widgets.js +++ b/addons/account/static/src/js/account_reconciliation_widgets.js @@ -1000,7 +1000,7 @@ var abstractReconciliationLine = Widget.extend({ var tax_id = self.tax_id_field.get("value"); if (amount && tax_id) { deferred_tax = self.model_tax - .call("json_friendly_compute_all", [[tax_id], amount, self.get("currency_id")]) + .call("json_friendly_compute_all", [[tax_id], amount, self.get("currency_id")], {context: {round: true}}) // just as the python will do .then(function(data){ line_created_being_edited.length = 1; // remove tax lines line_created_being_edited[0].amount_before_tax = amount;