From 1a2f0edbbbbae025970435a66ac0ff5eb76d8679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 22 May 2018 23:38:36 +0200 Subject: [PATCH] Add _request context to with_transaction wrapper issue7444 review45151002 --- trytond/protocols/wrappers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/protocols/wrappers.py b/trytond/protocols/wrappers.py index ecb70b8b19..3a9d930113 100644 --- a/trytond/protocols/wrappers.py +++ b/trytond/protocols/wrappers.py @@ -134,10 +134,11 @@ def with_transaction(readonly=None): readonly_ = False else: readonly_ = True + context = {'_request': request.context} for count in range(config.getint('database', 'retry'), -1, -1): with Transaction().start( - pool.database_name, 0, readonly=readonly_ - ) as transaction: + pool.database_name, 0, readonly=readonly_, + context=context) as transaction: try: result = func(request, pool, *args, **kwargs) except DatabaseOperationalError: