[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) <vsc@odoo.com>
This commit is contained in:
Vincent Schippefilt
2022-07-28 05:04:42 +02:00
parent 84a96c1838
commit ac10137220
+1 -1
View File
@@ -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)