跳至内容
菜单
此问题已终结
1 回复
3540 查看

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
8月 24
21183
0
12月 22
2512
2
3月 15
5876
2
3月 25
5790
3
2月 24
4686