تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
9851 أدوات العرض

I'm trying to use field access rights to restrict access to a specific group. I added the group under access rights on the field, but the field is still visible and editable by users who aren't in the group. I've refreshed the page, but the field is still visible in form view and search. Is there a step I am missing? I'm using Odoo Online v12.

الصورة الرمزية
إهمال

Did you found any solution?

أفضل إجابة

Hi,

If you specify a group along with the field definition, the field will be visible only for the users in the specified group. If you are doing from the code, you can do it like this,

<field name="test_field" groups="external_id_of_group"/>

In your case, while testing the same you have to make sure that the users inside the group, You can see a menu named Groups under setting menu, open your group and see which all users are there in the group. And login to the database with a user who is not there in the group and see whether the field is visible for him or not.

If you want to know more about the security mechanism in Odoo, see this: Security in Odoo - Access Control, Record Rules and Group

Thanks

الصورة الرمزية
إهمال

Hi Niyas,

It's not working while doing via code.

أفضل إجابة

Another way is to define to which groups it will be visible directly on the declaration of the field on the python model file
i.e:

work_email = fields.Char('Work Email', groups=('om_hr_payroll.group_hr_payroll_manager'))


الصورة الرمزية
إهمال
أفضل إجابة
Partner Tutorial: Introduction to Access Rights in Odoo

https://www.youtube.com/watch?v=VKs7XG-y2-Q

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
ديسمبر 19
4897
2
أغسطس 23
2783
1
مارس 25
2523
1
فبراير 24
2501
2
ديسمبر 22
3323