Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5079 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
how to read field values using js แก้ไขแล้ว
1
พ.ค. 25
8259
1
พ.ย. 24
4952
0
พ.ค. 24
2111
Odoo 14: Reload Point Of Sale แก้ไขแล้ว
1
เม.ย. 24
2059
1
ก.พ. 24
2770