details: https://code.tryton.org/tryton/commit/e21f16e6324a
branch: 7.8
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
(grafted from 7217ae50b90acf5ea31bac911239222d8f2cd5e2)
diffstat:
trytond/trytond/wizard/wizard.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r 6721dc0b22e1 -r e21f16e6324a trytond/trytond/wizard/wizard.py
--- a/trytond/trytond/wizard/wizard.py Mon Dec 29 20:47:40 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):