From ebd82065559968876970be30544e85249ea0cde6 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 12 Oct 2017 14:51:49 +0200 Subject: [10.0][FIX] pos_cache: unable to refresh cache in a multi-company context --- addons/pos_cache/models/pos_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/pos_cache/models/pos_cache.py') diff --git a/addons/pos_cache/models/pos_cache.py b/addons/pos_cache/models/pos_cache.py index fb0fb20641e..eed948b7981 100644 --- a/addons/pos_cache/models/pos_cache.py +++ b/addons/pos_cache/models/pos_cache.py @@ -23,10 +23,10 @@ class pos_cache(models.Model): @api.one def refresh_cache(self): - products = self.env['product.product'].search(self.get_product_domain()) + Product = self.env['product.product'].sudo(self.compute_user_id.id) + products = Product.search(self.get_product_domain()) prod_ctx = products.with_context(pricelist=self.config_id.pricelist_id.id, display_default_code=False, lang=self.compute_user_id.lang) - prod_ctx = prod_ctx.sudo(self.compute_user_id.id) res = prod_ctx.read(self.get_product_fields()) datas = { 'cache': base64.encodestring(cPickle.dumps(res)), -- cgit v1.2.3