details:   https://code.tryton.org/tryton/commit/7217ae50b90a
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Dec 23 09:52:40 2025 +0100
description:
        Save wizard session states in new transaction for readonly wizard

        The transaction is readonly which prevents to save in the database the 
session
        with states.

        Closes #14442
diffstat:

 trytond/trytond/wizard/wizard.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 0b69c726fc26 -r 7217ae50b90a trytond/trytond/wizard/wizard.py
--- a/trytond/trytond/wizard/wizard.py  Fri Dec 19 19:44:31 2025 +0100
+++ b/trytond/trytond/wizard/wizard.py  Tue Dec 23 09:52:40 2025 +0100
@@ -352,7 +352,11 @@
             wizard.model.log(
                 wizard.records, 'wizard',
                 f'{cls.__name__}:{state_name}')
-        wizard._save()
+        if transaction.readonly:
+            with transaction.new_transaction():
+                wizard._save()
+        else:
+            wizard._save()
         return result
 
     def _execute(self, state_name):

Reply via email to