콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
11302 화면

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.

관련 게시물 답글 화면 활동
0
11월 21
1069
0
4월 18
3507
0
9월 21
1889
1
11월 21
16335
3
5월 25
1709