[FIX] event: event stat button
Display stat button to groups who have read access to events.
This commit is contained in:
committed by
Nicolas Martinelli
parent
804d68efe5
commit
7aef847585
@@ -9,6 +9,8 @@ class ResPartner(models.Model):
|
||||
event_count = fields.Integer("Events", compute='_compute_event_count', help="Number of events the partner has participated.")
|
||||
|
||||
def _compute_event_count(self):
|
||||
if not self.user_has_groups('event.group_event_user'):
|
||||
return
|
||||
for partner in self:
|
||||
partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user