[FIX] pos_cache: take into account language of the compute user

Otherwise you'll always end up with untranslated product names.

Fixes #10736
This commit is contained in:
Joren Van Onder
2016-02-05 15:29:14 +01:00
parent bc03c915d4
commit ca3f3552f8
+2 -1
View File
@@ -23,7 +23,8 @@ class pos_cache(models.Model):
@api.one
def refresh_cache(self):
products = self.env['product.product'].search(self.get_product_domain())
prod_ctx = products.with_context(pricelist=self.config_id.pricelist_id.id, display_default_code=False)
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 = {