[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 <kba@odoo.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user