From 9e4d8baa6ccecabddceadc1578813c67238c8e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Aug 2011 19:12:19 +0200 Subject: [PATCH] Cursor cache must depend of the user review90002 --- trytond/backend/database.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trytond/backend/database.py b/trytond/backend/database.py index 6a7357bdbe..808c0d10c7 100644 --- a/trytond/backend/database.py +++ b/trytond/backend/database.py @@ -115,6 +115,8 @@ class CursorInterface(object): :return: the cache dictionary ''' from trytond.cache import LRUDict + from trytond.transaction import Transaction + user = Transaction().user if context is None: context = {} cache_ctx = context.copy() @@ -122,7 +124,7 @@ class CursorInterface(object): '_delete_records'): if i in cache_ctx: del cache_ctx[i] - return self.cache.setdefault(repr(cache_ctx), + return self.cache.setdefault((user, repr(cache_ctx)), LRUDict(MODEL_CACHE_SIZE)) def execute(self, sql, params=None):