From 11b34feb62edea12c10fd943e83364fa814e6d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 2 May 2021 11:02:03 +0200 Subject: [PATCH] Use user id instead of root to fill context rule issue10348 review342261002 --- ir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ir.py b/ir.py index b7a6a9abd1..2807fe7dbd 100644 --- a/ir.py +++ b/ir.py @@ -74,8 +74,9 @@ class Rule(metaclass=PoolMeta): 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):