From 5437dbf5dc3a56baa7cb9eda9436d89925d35882 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Fri, 8 Oct 2021 14:10:04 +0000 Subject: [PATCH] [FIX] hr: fix avatar generation on employee rename It was not possible to rename an employee with an existing image profile, as it was trying to assign the size of the avatar (coming from the webclient) as the avatar itself. closes odoo/odoo#78299 Taskid: 2660773 X-original-commit: 425ddb217664ba3fdae9e8c1527317fee0fe9368 Signed-off-by: Kevin Baptiste --- 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 2647a669c90..f61da5f56b4 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -150,7 +150,7 @@ class HrEmployeePrivate(models.Model): def _compute_avatar(self, avatar_field, image_field): for employee in self: - avatar = employee[image_field] + avatar = employee._origin[image_field] if not avatar: if employee.user_id: avatar = employee.user_id[avatar_field]