diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index ca4ce1c6f7267b257bc4be3739c2e7f33628ee25..2299375dd22c558ae0dea728858378449a848b04 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -356,16 +356,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 'user_id' in vals: # 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)