From b89f630d73a2c0eeadb0946c7976d3e2c114d18a Mon Sep 17 00:00:00 2001 From: Patrick Hoste Date: Mon, 31 Jan 2022 13:13:45 +0000 Subject: [PATCH] [FIX] event_booth_sale: add ondelete cascade to sol in registrations PURPOSE Before this commit it's impossible to unlink a sale order line containing a booth product (the ondelete parameter is unset thus default to restrict) After this commit this bug is fixed. Further explanation on the task implying a bug on the database setting the on delete to cascade despite the default value... LINKS Task-2749521 PR : odoo/odoo#83685 closes odoo/odoo#83767 X-original-commit: e8d96fb1cfd5016f12dc43b988a8a0450bf36a04 Signed-off-by: Thibault Delavallee (tde) --- addons/event_booth_sale/models/event_booth_registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event_booth_sale/models/event_booth_registration.py b/addons/event_booth_sale/models/event_booth_registration.py index a08a4bfc845..b80f66ea737 100644 --- a/addons/event_booth_sale/models/event_booth_registration.py +++ b/addons/event_booth_sale/models/event_booth_registration.py @@ -11,7 +11,7 @@ class EventBoothRegistration(models.Model): _name = 'event.booth.registration' _description = 'Event Booth Registration' - sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line', required=True) + sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line', required=True, ondelete='cascade') event_booth_id = fields.Many2one('event.booth', string='Booth', required=True) partner_id = fields.Many2one( 'res.partner', related='sale_order_line_id.order_partner_id', store=True)