Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3528 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

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.

Autor

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 Odpovědi Zobrazení Aktivita
5
srp 24
21153
0
pro 22
2496
2
bře 15
5861
2
bře 25
5786
3
úno 24
4678