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

        issue10348
        review342261002
        (grafted from d85d7a4ec6ca4ef4648d996ef458708f1a07c51a)
diffstat:

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

diffs (14 lines):

diff -r 625fa1771364 -r 7e81da3d3ead ir.py
--- a/ir.py     Fri Jan 01 17:02:07 2021 +0100
+++ b/ir.py     Sun May 02 11:02:03 2021 +0200
@@ -72,8 +72,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