[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-06-20 08:16:10 +00:00
parent fa492d87f4
commit ea4ddff117
@@ -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');
}
});