diff --git a/addons/account/models/account.py b/addons/account/models/account.py index b81fd23cdda..cde4781888e 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -779,6 +779,7 @@ class AccountTax(models.Model): 'account_id': tax.account_id.id, 'refund_account_id': tax.refund_account_id.id, 'analytic': tax.analytic, + 'price_include': tax.price_include, }) return { diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js index 11116fab070..36c855111f7 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_model.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js @@ -770,6 +770,8 @@ var StatementModel = BasicModel.extend({ '__focus': false }); + prop.computed_with_tax = tax.price_include + prop.tax_amount = tax.amount prop.amount = tax.base; prop.amount_str = field_utils.format.monetary(Math.abs(prop.amount), {}, formatOptions); prop.invalid = !self._isValid(prop); @@ -1040,7 +1042,8 @@ var StatementModel = BasicModel.extend({ * @returns {object} */ _formatToProcessReconciliation: function (line, prop) { - var amount = -prop.amount; + // Do not forward port in master. @CSN will change this + var amount = prop.computed_with_tax && -prop.base_amount || -prop.amount; if (prop.partial_reconcile === true) { amount = -line.st_line.amount; } @@ -1048,6 +1051,10 @@ var StatementModel = BasicModel.extend({ name : prop.label, debit : amount > 0 ? amount : 0, credit : amount < 0 ? -amount : 0, + // This one isn't usefull for the server, + // But since we need to change the amount (and thus its semantics) into base_amount + // It might be useful to have a trace in the RPC for debugging purposes + computed_with_tax: prop.computed_with_tax, }; if (!isNaN(prop.id)) { result.counterpart_aml_id = prop.id;