From ea4ddff117ef5015c7e8c2db551a9399930177b7 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 20 Jun 2019 08:11:08 +0000 Subject: [PATCH] [FIX] point_of_sale: apply fiscal position - Create 2 included taxes: 21 % and 6 % - Create a product A with 21 % as default tax - Create a fiscal position to map the tax 21 % to tax 6 % - Allow the fiscal position in the POS - Add product in a POS order - Apply the fiscal position The subtotal is not recomputed correctly. On the other hand, if the fiscal is first set then the product added, there is no problem. This is because the `fix_tax_included_price` is only called by `add_product` and not when changing the fiscal position. opw-2020755 closes odoo/odoo#34260 Signed-off-by: Nicolas Martinelli (nim) --- addons/point_of_sale/static/src/js/screens.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 02069ce2cdd..48db503921b 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -2095,6 +2095,10 @@ var set_fiscal_position_button = ActionButtonWidget.extend({ confirm: function (fiscal_position) { var order = self.pos.get_order(); order.fiscal_position = fiscal_position; + // Fix the taxes on existing lines + _.each(order.get_orderlines(), function (line) { + order.fix_tax_included_price(line); + }); order.trigger('change'); } });