[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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user