Skip to content

Commit

Permalink
[FIX] hr_equipment: no technician subscribe in 9.0
Browse files Browse the repository at this point in the history
In 9.0, an "Human Resources / Employee" see only hr.equipment for which
they are set as the "Employee".

But the code automatically subscribed the "Technician" because the field
name was named technically "user_id" which is automatically subscribed
by the system.

This led to a possible issue with read / unread message because of
feature that just happen by coincidence.

For 9.0 only (in 10.0 the field has been renamed technician_user_id and
access rules have been changed).

opw-805185
closes odoo#22273
  • Loading branch information
nle-odoo committed Jan 16, 2018
1 parent 11c73cd commit 23a2bac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions addons/hr_equipment/models/hr_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ def write(self, vals):
self.message_subscribe_users(user_ids=user_ids)
return super(HrEquipment, self).write(vals)

@api.model
def _message_get_auto_subscribe_fields(self, updated_fields, auto_follow_fields=None):
""" mail.thread override so user_id which has no special access allowance is not
automatically subscribed.
"""
if auto_follow_fields is None:
auto_follow_fields = []
return super(HrEquipment, self)._message_get_auto_subscribe_fields(updated_fields, auto_follow_fields)

@api.multi
def _read_group_category_ids(self, domain, read_group_order=None, access_rights_uid=None):
""" Read group customization in order to display all the category in the
Expand Down

0 comments on commit 23a2bac

Please sign in to comment.