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

Hello,


I am working with a piece of JS code which states:

    if (session.is_system) {

From what I can gather this only returns True when they have admin rights to settings.


I would like it to only run when they are an internal user. 


In Python it would be something like this:

    user.has_group('base.group_user'):

How would I replicate this in Odoo?


Thanks, 


  

아바타
취소
베스트 답변

you can use something like


const session = require('web.session');
......
......
const isInternaluser = await session.user_has_group('base.group_user');
if ( isInternaluser) { ... }
아바타
취소
작성자

Hello Ravi, thank you for the code! Just to confirm, is "is_system" only have settings to admin access rights?

is_system is a superuser, it has all the access rights.

which odoo version are you using?

some business login has been changed related to superuser in V13

작성자

Hello Ravi, I am on Version 13 Enterprise Odoo.sh

For some reason, this condition is implemented in Javascript when it should be available for all users not just Admin.

관련 게시물 답글 화면 활동
1
5월 25
8265
1
11월 24
4955
0
5월 24
2122
1
4월 24
2069
1
2월 24
2776