From e93b3230a07bf6fbff0c744f81c5307a047f2a26 Mon Sep 17 00:00:00 2001 From: bjouini Date: Tue, 25 Aug 2026 11:17:09 +0100 Subject: [PATCH] [FIX] contract_line_successor: always call _prepare_value_for_stop() on stop() Before, when the date_end we want to set was not smaller than the line's current date_end, stop did not call _prepare_value_for_stop. It only wrote is_auto_renew and manual_renew_needed by hand instead. This is a problem because other modules can override _prepare_value_for_stop() to add their own logic If stop() does not call this method, all that logic is skipped and their values are never saved. Now _prepare_value_for_stop is always called. We still never make date_end bigger than what it already is we just make sure the method is called in all cases so custom values from other modules are not lost. --- contract_line_successor/models/contract_line.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contract_line_successor/models/contract_line.py b/contract_line_successor/models/contract_line.py index 597658a652..38230eb645 100644 --- a/contract_line_successor/models/contract_line.py +++ b/contract_line_successor/models/contract_line.py @@ -441,10 +441,7 @@ def stop(self, date_end, manual_renew_needed=False, post_message=True): rec.contract_id.message_post(body=msg) else: rec.write( - { - "is_auto_renew": False, - "manual_renew_needed": manual_renew_needed, - } + rec._prepare_value_for_stop(rec.date_end, manual_renew_needed) ) return True