openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #10788
[Bug 988743] Re: Invalid lookup in ormcache()
In fact, the problem is the following :
1) You check if the data already is in the cache : d[key]
2) If it's the case, you return it.
3) If it's not the case, you get the value, and save it in the dictionnary "d".
The problem is that when you save the value, you set d[args] instead of
d[key]. So, imagine :
key = 'a'
args 'b'
d[key] => Not cached
Then
d[args] = Result => THIS IS WRONG ! It should be d[key] = Result !
In our case, args is the same than key if self.skipargs = 2. However, if
self.skipargs is defferent than 2, they won't be the same, and the value
will never get cached correctly.
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/988743
Title:
Invalid lookup in ormcache()
Status in OpenERP Server:
Incomplete
Bug description:
Hi,
In ormcache(), you check if the data is present using the "key"
variable, and you define it using "args" [1], which is not the same.
The first one is based on self.skiparg, whereas the second is not.
So, for decorators which set the "skiparg" arguments, if it is
different of 2, the cache won't work. The fix is simply to set d[key]
inseatd of d[args].
[1] : http://bazaar.launchpad.net/~openerp/openobject-
server/trunk/view/head:/openerp/tools/cache.py#L46
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/988743/+subscriptions
References