diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index b5a9b92fc19..d930898ae6e 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2052,9 +2052,9 @@ exports.Orderline = Backbone.Model.extend({ } return taxes; }, - _map_tax_fiscal_position: function(tax) { + _map_tax_fiscal_position: function(tax, order = false) { var self = this; - var current_order = this.pos.get_order(); + var current_order = order || this.pos.get_order(); var order_fiscal_position = current_order && current_order.fiscal_position; var taxes = []; @@ -2266,7 +2266,7 @@ exports.Orderline = Backbone.Model.extend({ var tax = _.detect(taxes, function(t){ return t.id === el; }); - product_taxes.push.apply(product_taxes, self._map_tax_fiscal_position(tax)); + product_taxes.push.apply(product_taxes, self._map_tax_fiscal_position(tax, self.order)); }); product_taxes = _.uniq(product_taxes, function(tax) { return tax.id; }); @@ -2297,7 +2297,7 @@ exports.Orderline = Backbone.Model.extend({ var new_included_taxes = []; var self = this; _(taxes).each(function(tax) { - var line_taxes = self._map_tax_fiscal_position(tax); + var line_taxes = self._map_tax_fiscal_position(tax, order); if (line_taxes.length && line_taxes[0].price_include){ new_included_taxes = new_included_taxes.concat(line_taxes); }