[FIX] event: use sudo to compute event_count

You could not see the partner page when not having the event rights.
This commit is contained in:
RomainLibert
2018-06-08 16:33:45 +02:00
parent a002210d93
commit c0618d72d0
+1 -1
View File
@@ -10,7 +10,7 @@ class ResPartner(models.Model):
def _compute_event_count(self):
for partner in self:
partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)])
partner.event_count = self.env['event.event'].sudo().search_count([('registration_ids.partner_id', 'child_of', partner.ids)])
@api.multi
def action_event_view(self):