Force language at login

61 views
Skip to first unread message

Nicolas Micoud

unread,
May 18, 2022, 3:41:13 AM5/18/22
to iDempiere
Hi,

Since we migrate to v9, I cannot use System user to log in the System.
Before that, I was using 2 browsers :
#1 was dedicated to "real" tenants, with preferences login = SuperUser ; Language = French
#2 was dedicated to System tenant, with preferences login = System ; Language = English (I think English is better in System - no translation issue)

Now, I have to use SuperUser in both browsers and preferences are shared.
So, when I need to enter in a tenant which is different that the one in the preferences, I have to write the password, change the language and then I can log, which is a bit frustrating (as it is done several times a day).

So my idea (until I can migrate to v10 and be able to use System user again) is to "force" the language for SuperUser, according to the tenant.

In my plugin, I've added this piece of code

if (topic.equals(IEventTopics.PREF_AFTER_LOAD)) {

    if (Env.getAD_User_ID(Env.getCtx()) == USER_SUPERUSER && MSysConfig.getBooleanValue("XXA_FORCE_LANGUAGE_AT_LOGIN", false)) {
        Language.setLoginLanguage(Env.getAD_Client_ID(Env.getCtx()) == 0 ? Language.getBaseLanguage() : Language.getLanguage("fr-FR"));
        return;
    }
}

which seems to work fine locally.

Do you see any issue deploying in a production instance?

Thanks,

Nicolas

Heng Sin Low

unread,
May 18, 2022, 3:43:24 AM5/18/22
to idem...@googlegroups.com
hmm ... isn't that just the matter of adding another user to the system tenant ?

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/9f9cb154-58a9-4de5-83e9-4d499f53ab6en%40googlegroups.com.

Nicolas Micoud

unread,
May 18, 2022, 4:09:50 AM5/18/22
to iDempiere
Hum, that's correct, I was conviced that the userID was used in 2Pack (as I'm using 2Pack to transfer stuff from dev to prod instances), and so I thought I had to create those user with IDs < 1000000.
So, yes, your solution seems easier with no change !
Thanks

Carlos Antonio Ruiz Gomez

unread,
May 18, 2022, 11:29:44 AM5/18/22
to idem...@googlegroups.com
Why can't you login as System user?

I just tested in demo.globalqss.com (release-9) and I can login with
System (ID=0)

And tested in test.idempiere.org (master) and I can login with "system @
idempiere.com" (ID=10)

Regards,

Carlos Ruiz


El 18/5/22 a las 9:41, Nicolas Micoud escribió:
> Nicolas --

Nicolas Micoud

unread,
May 19, 2022, 12:20:45 AM5/19/22
to iDempiere
System user is not usable as you can't fill a field with type = Search ; it will throw an error when the panel opens.
Thus, is not possible to create a 2Pack or add a column in a table.
In other words, System is useless in v9.

Regards,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
May 19, 2022, 6:03:20 AM5/19/22
to idem...@googlegroups.com
Hi Nicolas, I didn't see that before, that's not intentional, is a bug.

From what is another issue related to IDEMPIERE-4863:

Database Error.: DBExecuteError:ERROR: null value in column "ad_user_id" of relation "ad_wlistbox_customization" violates not-null constraint
Detail: Failing row contains (0, 0, null, 1000081, 45d22e6f-efbe-464b-9a33-f43bc9ff6135, 2022-05-19 04:59:45.716, 0, AD_Message_ID=null,AD_Client_ID=null,AD_Org_ID=null,Value=null,I..., Y, 2022-05-19 04:59:45.716, 0, AD_InfoPanel|AD_Message).[SQL: 0, 23502]

Reopening the ticket pointing to this thread.

Regards,

Carlos Ruiz


El 19/5/22 a las 6:20, Nicolas Micoud escribió:

Nicolas Micoud

unread,
May 19, 2022, 6:17:19 AM5/19/22
to iDempiere
Hi Carlos,
As System user was deprecated, I didn't addressed this issue and give up using him.

Thanks

Nicolas

Nicolas Micoud

unread,
May 19, 2022, 9:23:46 AM5/19/22
to iDempiere
Reply all
Reply to author
Forward
0 new messages