From 19a8c8fac617d8f0fcd39b37b4f429f18b3451ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 17 Jun 2022 09:06:18 +0000 Subject: [PATCH] [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 --- addons/event_booth_sale/models/event_booth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event_booth_sale/models/event_booth.py b/addons/event_booth_sale/models/event_booth.py index e03df7942a4..1e00e4a6d09 100644 --- a/addons/event_booth_sale/models/event_booth.py +++ b/addons/event_booth_sale/models/event_booth.py @@ -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: '