changeset d85d7a4ec6ca in modules/company:default
details: https://hg.tryton.org/modules/company?cmd=changeset&node=d85d7a4ec6ca
description:
        Use user id instead of root to fill context rule

        issue10348
        review342261002
diffstat:

 ir.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 50c7c16200cd -r d85d7a4ec6ca ir.py
--- a/ir.py     Sun May 02 10:30:11 2021 +0200
+++ b/ir.py     Sun May 02 11:02:03 2021 +0200
@@ -74,8 +74,9 @@
         Employee = pool.get('company.employee')
         context = super()._get_context()
         # Use root to avoid infinite loop when accessing user attributes
+        user_id = Transaction().user
         with Transaction().set_user(0):
-            user = User(Transaction().user)
+            user = User(user_id)
         if user.employee:
             with Transaction().set_context(
                     _check_access=False, _datetime=None):

Reply via email to