IDEMPIERE-5131 Base language cannot be changed by process 'change base language' (#1100)
This commit is contained in:
parent
bf67ba45e0
commit
75bc20b404
|
@ -72,7 +72,8 @@ public class ChangeBaseLanguage extends SvrProcess
|
|||
if (Util.isEmpty(p_Language))
|
||||
throw new AdempiereUserError("Language required");
|
||||
|
||||
MLanguage lang = MLanguage.get(getCtx(), p_Language);
|
||||
MLanguage langCached = MLanguage.get(getCtx(), p_Language);
|
||||
MLanguage lang = new MLanguage(getCtx(), langCached.getAD_Language_ID(), get_TrxName());
|
||||
if (lang.isBaseLanguage())
|
||||
throw new AdempiereUserError("Same base language");
|
||||
if (lang.isSystemLanguage())
|
||||
|
@ -82,7 +83,8 @@ public class ChangeBaseLanguage extends SvrProcess
|
|||
throw new AdempiereUserError("Same base language");
|
||||
|
||||
// Disable the base flag on the actual
|
||||
MLanguage baselang = MLanguage.get(getCtx(), Language.getBaseAD_Language());
|
||||
MLanguage baselangCached = MLanguage.get(getCtx(), Language.getBaseAD_Language());
|
||||
MLanguage baselang = new MLanguage(getCtx(), baselangCached.getAD_Language_ID(), get_TrxName());
|
||||
baselang.setIsBaseLanguage(false);
|
||||
baselang.saveEx(get_TrxName());
|
||||
|
||||
|
|
|
@ -152,7 +152,8 @@ public class Translation implements IApplication
|
|||
SAXParser parser = factory.newSAXParser();
|
||||
parser.parse(in, handler);
|
||||
if (log.isLoggable(Level.INFO)) log.info("Updated=" + handler.getUpdateCount());
|
||||
MLanguage lang = MLanguage.get(m_ctx, AD_Language);
|
||||
MLanguage langCached = MLanguage.get(m_ctx, AD_Language);
|
||||
MLanguage lang = new MLanguage(m_ctx, langCached.getAD_Language_ID(), null);
|
||||
if (! lang.isLoginLocale()) {
|
||||
lang.setIsLoginLocale(true);
|
||||
lang.saveEx();
|
||||
|
|
Loading…
Reference in New Issue