[FIX] event_sale: update registrations as sudo.

Consequence of 19878d011f

Backport of fb17edd0b0
This commit is contained in:
Christophe Simonis
2018-05-16 11:05:16 +02:00
committed by Olivier Dony
parent 19878d011f
commit 9db6dfa25d
+1 -1
View File
@@ -56,7 +56,7 @@ class sale_order_line(osv.osv):
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)])
for so_line in [l for l in self if l.event_id]:
existing_registrations = registrations.filtered(lambda self: self.sale_order_line_id.id == so_line.id)