Skip to content

Commit

Permalink
[FIX] event_sale: update registrations as sudo.
Browse files Browse the repository at this point in the history
Consequence of 19878d0
  • Loading branch information
KangOl committed May 15, 2018
1 parent f1ae96e commit fb17edd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/event_sale/models/sale_order.py
Expand Up @@ -41,7 +41,7 @@ def _update_registrations(self, confirm=True, cancel_to_draft=False, registratio
order line has a product_uom_qty attribute that will be the number of
registrations linked to this line. This method update existing registrations
and create new one for missing one. """
Registration = self.env['event.registration']
Registration = self.env['event.registration'].sudo()
registrations = Registration.search([('sale_order_line_id', 'in', self.ids), ('state', '!=', 'cancel')])
for so_line in self.filtered('event_id'):
existing_registrations = registrations.filtered(lambda self: self.sale_order_line_id.id == so_line.id)
Expand Down

0 comments on commit fb17edd

Please sign in to comment.