Skip to content

Commit

Permalink
[FIX] Override groups field on activity.record.rule to avoid to use t…
Browse files Browse the repository at this point in the history
…he same relation like ir.rule
  • Loading branch information
adrienpeiffer committed Aug 25, 2016
1 parent 451c5d6 commit 9db025c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion workflow_activity_action/models/activity_record_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def _domain_force_get(self):
required=True)
model_id = fields.Many2one(required=False, readonly=True)
domain = fields.Binary(compute='_domain_force_get', string='Domain')
groups = fields.Many2many(
comodel_name='res.groups', relation='activity_rule_group_rel',
column1='rule_group_id', column2='group_id', string='Groups')

@api.cr_uid
def clear_cache(self, cr, uid):
Expand Down Expand Up @@ -92,7 +95,7 @@ def _local_compute_activity_rule_domain(self, activity_id):
FROM activity_record_rule r
WHERE r.active is True
AND r.activity_id = %s
AND (r.id IN (SELECT rule_group_id FROM rule_group_rel g_rel
AND (r.id IN (SELECT rule_group_id FROM activity_rule_group_rel g_rel
JOIN res_groups_users_rel u_rel ON (g_rel.group_id = u_rel.gid)
WHERE u_rel.uid = %s) OR r.global)""", (activity_id,
self._uid))
Expand Down

0 comments on commit 9db025c

Please sign in to comment.