Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
11239 Переглядів

Hi

how i can access fields values by java script ?

i tried to get language field value in java script variable, but i failed.

and i tried to know where is the function that retrieve the current language, and i failed too.

so please anyone can help me

Аватар
Відмінити
Найкраща відповідь
Confirm, this approach posted by Handelux worked like a charm, tested on v16
var lang = ('; '+document.cookie).split(`; frontend_lang=`).pop().split(';')[0];

Аватар
Відмінити
Найкраща відповідь

User language is stored in a cookie frontend_lang so you can access it with pure javascript:

var lang = ('; '+document.cookie).split(`; frontend_lang=`).pop().split(';')[0];
Аватар
Відмінити
Найкраща відповідь

The language value should be instance.session.user_context.lang.

Аватар
Відмінити
Автор

please i am new in openerp. so where i can find "instance.session.user_context.lang" and how to put language in alert message

You need to read the OpenERP web module development guide. instance is sent by OpenERP to web modules during session startup.

Related Posts Відповіді Переглядів Дія
0
лист. 21
1044
0
квіт. 18
3434
0
вер. 21
1849
1
лист. 21
16241
3
трав. 25
1560