Through
https://idempiere.atlassian.net/browse/IDEMPIERE-2235 and this commit
https://bitbucket.org/idempiere/idempiere/commits/ff199a11605edfbe9213ef78ea2fdc071775cfb3, we add ability to force reload of translations.
But majority of methods are still using PO.get_Translation (String columnName, String AD_Language).
Means that if the translated name of the doc type has changed, you'll still get the old value.
For instance, I have a callout which populate fields using stuff from another table.
Here's the code :
MXXAModel myModel = new MXXAModel(ctx, id, null);
mTab.setValue("Name", myModel.get_Translation("Name"));
mTab.setValue("Description", myModel.get_Translation("Description"));
Using it, i'm filling fields with wrong values.
As I don't want to force a reload on every call, my idea was to reset the cache when a name or description (from source table) is updated.
Haven't tested but calling (String columnName, String AD_Language, boolean reload) in a afterSave method (if name or description has been updated) should do the job.
Can it be done directly in PO ?
Maybe at the end of the saveFinish method ?
WDYT ?
Thanks,
Nicolas