From ac101372201647f6f2a29a0fcd88cc36ed830eb1 Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Wed, 27 Jul 2022 12:07:36 +0000 Subject: [PATCH] [FIX] hr_appraisal: cache miss as demo user Since eb67feb5 we had to redo the hack to read fields from public user and set them in hr_employee. However in this hack we used `_read`, which doesn't fill the cache with fields that are not stored, which caused a cache miss when reading the field `avatar_128` from hr.employee, to display the image of the manager in the kanban view of hr_appraisal. This fix uses `read` instead. closes odoo/odoo#96889 Signed-off-by: Vincent Schippefilt (vsc) --- addons/hr/models/hr_employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index 2f7166f3c93..03e8ca50af7 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -186,7 +186,7 @@ class HrEmployeePrivate(models.Model): # cache, and interpreted as an access error self.flush_recordset(fields) public = self.env['hr.employee.public'].browse(self._ids) - public._read(fields) + public.read(fields) for fname in fields: values = self.env.cache.get_values(public, public._fields[fname]) self.env.cache.update(self, self._fields[fname], values)