From b45e65a9d489a9b04d82af6b72d35fd2eda3e56a Mon Sep 17 00:00:00 2001
From: "Guillaume (guva)" <guva@odoo.com>
Date: Mon, 19 Jul 2021 08:51:36 +0000
Subject: [PATCH] [FIX] event_sale : unable to delete multiple SO

Step to reproduce:

- go to sale app
- select several SO
- action menu > delete
- got a traceback

Change the unlink definition to get multiple elements with mapped.
This fix an issue introduced on PR 72253

opw-2605699

closes odoo/odoo#73942

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
---
 addons/event_sale/models/sale_order.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py
index 01de46bdc433..81e35d999113 100644
--- a/addons/event_sale/models/sale_order.py
+++ b/addons/event_sale/models/sale_order.py
@@ -25,7 +25,7 @@ class SaleOrder(models.Model):
         return res
 
     def unlink(self):
-        self.order_line._unlink_associated_registrations()
+        self.mapped('order_line')._unlink_associated_registrations()
         super(SaleOrder, self).unlink()
 
 
-- 
GitLab