diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-11-10 11:02:25 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-11-10 15:59:40 +0000 |
| commit | 5fbd843bf089d0b7186e530266a6a7714432e90a (patch) | |
| tree | 73e4f9d27a530ea3edaf4e0ad575ea22efb7495d /addons | |
| parent | 1fe852e032876f2f3212a43fc3115e49f4de618d (diff) | |
[FIX] point_of_sale: fix included -> excluded tax mapping
- Create a sale tax T1, 0% included in price
- Create a sale tax T2, 15%
- Create a product PROD1 with a sale price of 10 and T1
- Create a fiscal position FPOS and map T1 to T2
- Go to POS
- Select PROD1:
- Without FPOS the price should be 10 and tax 0
- With FPOS, price should be 10 and tax 1.5
POS calculate the tax twice, makeing the price 11,50 and an extra tax of
15% to 13,23.
This is a fine tuning of 1baa774bc7a1d6cabcb3d61ff19ec2d6010fbd6a
to distinguish between included-excluded tax after mapping and avoid the
double computation.
opw-2374247
closes odoo/odoo#61600
X-original-commit: 65c5b54c19e66674d3df35b651059632c452a6c7
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index e2df08d9e8d..ed4b5318edf 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2301,7 +2301,9 @@ exports.Orderline = Backbone.Model.extend({ var self = this; _(taxes).each(function(tax) { var line_taxes = self._map_tax_fiscal_position(tax); - new_included_taxes = new_included_taxes.concat(line_taxes) + if (line_taxes.length && line_taxes[0].price_include){ + new_included_taxes = new_included_taxes.concat(line_taxes); + } if(tax.price_include && !_.contains(line_taxes, tax)){ mapped_included_taxes.push(tax); } |
