From 17e1f2f375fdbd72690c4fce2a41c5e6926ac8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Thu, 5 Jun 2025 08:42:31 +0200 Subject: [PATCH] [IMP] event_generate_quotation_from_registration: prevent edition attempts of done sale orders --- .../models/event_registration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/event_generate_quotation_from_registration/models/event_registration.py b/event_generate_quotation_from_registration/models/event_registration.py index f862595..ec7e575 100644 --- a/event_generate_quotation_from_registration/models/event_registration.py +++ b/event_generate_quotation_from_registration/models/event_registration.py @@ -36,8 +36,9 @@ class EventRegistration(models.Model): financier.quotation_id = sale_order else: order_lines = self.env['sale.order.line'].search([ - ('order_id','=',financier.quotation_id.id), - ('product_id','=',financier.get_product_id()) + ('order_id','=',financier.quotation_id.id), + ('product_id','=',financier.get_product_id()), + ('state', '!=', 'done'), ]) if order_lines: order_lines[0].price_unit = financier.amount