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

I have a custom model which have a many2one field about account and one2many field of sale orders.


In the tree view and form view, I just want the manager to see the account and sales information, base users would only consult the stardard info.


But even limiting the views with groups, the system ask for sale_order read permission

<field name="sale_amount_total" groups="sales_team.group_sale_salesman_all_leads"/>


Is the read permission on the model mandatory ? Does it mean that a base user will have read permission on the account model ?

الصورة الرمزية
إهمال
أفضل إجابة

If you've created a custom module you will need to set a permissions group for that model. Odoo by default doesn't create them. You can add permissions to a module via a permissions csv file, or add them manually through Odoo studio.

\https://www.odoo.com/forum/help-1/question/access-rights-with-file-csv-120150

After creating the initial permissions group, or assigning the modules permissions to an existing group, your groups constraint should work.

الصورة الرمزية
إهمال
الكاتب

I set the permissions for my model, the access denied comes from the field sale_ids because the base user doesn't have sale rights.

Gotcha, then yes you would have to put the permission for sales on the base user group. It may be better to create new permissions and add those to the base user and sales group respectively. I.e. base users have a permission to read this module, while the sales group can read and write.

الكاتب

Thank you (sorry can't mark as a valid answer)

So I need to give read permission on sales to the users in my custom module group

I believe so!

المنشورات ذات الصلة الردود أدوات العرض النشاط
5
أغسطس 24
21302
0
ديسمبر 22
2544
2
مارس 15
5908
2
مارس 25
5853
3
فبراير 24
4709