[FIX] maintenance: make equipments/requests visible to followers

It used to be based on owners, but owners are automatically
followers. Restricting on followers makes the visibility
of equipments and requests consistent with the mail notifications
linked to them.

Avoids issues with "phantom notifications" that appear in the
inbox counter but aren't visible.
This commit is contained in:
Olivier Dony
2017-01-31 19:21:56 +01:00
parent ac66f296aa
commit ac94537b47
+3 -3
View File
@@ -12,14 +12,14 @@
<record id="equipment_request_rule_user" model="ir.rule">
<field name="name">Users are allowed to access their own maintenance requests</field>
<field name="model_id" ref="model_maintenance_request"/>
<field name="domain_force">['|', ('owner_user_id.id', '=', user.id), ('technician_user_id.id', '=', user.id)]</field>
<field name="domain_force">['|', ('message_partner_ids', 'in', [user.partner_id.id]), ('technician_user_id.id', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>
<record id="equipment_rule_user" model="ir.rule">
<field name="name">Users are allowed to access their own equipments</field>
<field name="name">Users are allowed to access equipments they follow</field>
<field name="model_id" ref="model_maintenance_equipment"/>
<field name="domain_force">[('owner_user_id.id', '=', user.id)]</field>
<field name="domain_force">[('message_partner_ids', 'in', [user.partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>