Skip to content
Snippets Groups Projects
Commit decae33a authored by Kevin Baptiste's avatar Kevin Baptiste
Browse files

[FIX] hr: employee should be subscribed


The employee should be subscribed to their own record in order to
receive communication send to them.

closes odoo/odoo#112623

Taskid: 2749585
X-original-commit: 8760a4d0
Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
parent 66b65074
Branches
Tags
No related merge requests found
......@@ -293,6 +293,7 @@ class HrEmployeePrivate(models.Model):
self.env['mail.channel'].sudo().search([
('subscription_department_ids', 'in', employee.department_id.id)
])._subscribe_users_automatically()
employee.message_subscribe(employee.address_home_id.ids)
# Launch onboarding plans
url = '/web#%s' % url_encode({
'action': 'hr.plan_wizard_action',
......@@ -308,6 +309,8 @@ class HrEmployeePrivate(models.Model):
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']
self.message_unsubscribe(self.address_home_id.ids)
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']),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment