[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
This commit is contained in:
Lucas Perais (lpe)
2017-12-26 09:10:04 +01:00
parent be5950e429
commit 49cbeabe10
+1 -1
View File
@@ -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 = {};