[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 6fce298d70

OPW 1859939

closes #25733
This commit is contained in:
Lucas Perais (lpe)
2018-07-12 13:07:56 +02:00
parent dad19a769a
commit 755081cbf4
@@ -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;