← Back to team overview

openerp-expert-framework team mailing list archive

Re: Translation getters and cache

 

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