diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index 5247742c6ed09d9cbcb4a63d8d8f07ad8a195fb3..e452ebd635225a72c1b36d08e9ada9d8580c4714 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -306,16 +306,16 @@ class HrEmployeePrivate(models.Model): def write(self, vals): if 'address_home_id' in vals: - account_id = vals.get('bank_account_id') or self.bank_account_id.id - if account_id: - self.env['res.partner.bank'].browse(account_id).partner_id = vals['address_home_id'] + account_ids = vals.get('bank_account_id') or self.bank_account_id.ids + if account_ids: + self.env['res.partner.bank'].browse(account_ids).partner_id = vals['address_home_id'] self.message_unsubscribe(self.address_home_id.ids) if vals['address_home_id']: self._message_subscribe([vals['address_home_id']]) if vals.get('user_id'): # Update the profile pictures with user, except if provided vals.update(self._sync_user(self.env['res.users'].browse(vals['user_id']), - (bool(self.image_1920)))) + (bool(all(emp.image_1920 for emp in self))))) if 'work_permit_expiration_date' in vals: vals['work_permit_scheduled_activity'] = False res = super(HrEmployeePrivate, self).write(vals)