[FIX] event_booth_sale: fix ACLs issues at unlink

When unlinking booths a check is done on sale orders to prevent their deletion when
a SO is linked and raise a nice error message. However as there is a group on the
field (coming from Sales app) we should sudo the filtered.

Task-2842621

X-original-commit: 9cdc2eec25dd57a74be993b0db0fd81460d6aed6
Part-of: odoo/odoo#94475
This commit is contained in:
Thibault Delavallée
2022-06-24 10:29:50 +02:00
committed by Nasreddin Boulif (bon)
parent dd1a842c32
commit 19a8c8fac6
@@ -26,7 +26,7 @@ class EventBooth(models.Model):
@api.ondelete(at_uninstall=False)
def _unlink_except_linked_sale_order(self):
booth_with_so = self.filtered('sale_order_id')
booth_with_so = self.sudo().filtered('sale_order_id')
if booth_with_so:
raise UserError(_(
'You can\'t delete the following booths as they are linked to sales orders: '