From 49cbeabe104384abcd9d656ef4ed3f4ce94b5b99 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 18 Dec 2017 14:24:04 +0100 Subject: [PATCH] [FIX] point_of_sale: prevent taxes of another company to be loaded As admin every tax is loaded, which is wrong anyway. When the admin opens a session a change the cashier in the POS interface, every order is made with every tax ever (on the product) which could lead to major faulty records See the case on OPW 786803 which is critical --- addons/point_of_sale/static/src/js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 42d652a57dd..9975ca9e307 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -203,7 +203,7 @@ exports.PosModel = Backbone.Model.extend({ },{ model: 'account.tax', fields: ['name','amount', 'price_include', 'include_base_amount', 'amount_type', 'children_tax_ids'], - domain: null, + domain: function(self) {return [['company_id', '=', self.company && self.company.id || false]]}, loaded: function(self, taxes){ self.taxes = taxes; self.taxes_by_id = {};