openerp-expert-framework team mailing list archive
-
openerp-expert-framework team
-
Mailing list archive
-
Message #00335
Re: Translation getters and cache
-
To:
openerp-expert-framework <openerp-expert-framework@xxxxxxxxxxxxxxxxxxx>
-
From:
Olivier Dony <odo@xxxxxxxxxxx>
-
Date:
Thu, 24 Jun 2010 15:28:06 +0200
-
In-reply-to:
<1277366742.8783.14.camel@loulou>
-
Organization:
OpenERP
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Shredder/3.0.3pre
On 24/06/10 10:05, Équipe informatique wrote:
> Dear experts,
> I'm wondering about the way translations are cached in ir_translations:
> can someone please shed some light here?
>
> In bin/addons/base/ir/ir_translation.py, the functions _get_ids and
> _get_source are cached. I suppose they are used to fetch translations by
> id or by source, is that right ?
Yes, by res_id or source.
> Now, the methods create/write/unlink invalidate the cache when
> translations are changed, but:
> - the cache for _get_source is cleared for /the language in the
> translation record/
> - the cache for _get_ids is cleared for /the language in the context/
> Why are they not treated the same?
That wasn't right indeed, thanks for pointing it out, both should be
done using the language of the translation record.
This comes from a previous bugfix that was not applied consistently.
See https://bugs.launchpad.net/openobject-server/+bug/516030
Fixed in trunk @ rev 2410 and stable @ rev 2077.
Thanks!
References