Skip to Content
Menu
This question has been flagged
1 Reply
2549 Views

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 ?

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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.

Author

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!

Related Posts Replies Views Activity
5
Aug 24
15593
0
Dec 22
1502
2
Mar 15
4896
3
Feb 24
3141
2
Dec 23
11999