Skip to Content
Menú
This question has been flagged
1 Respondre
123 Vistes

Hi there

The internal user group does only have read access to the res.users model per Odoo default. Still, all users can open the "preferences", which is a view of res.users. How does Odoo do that?

I tried to create a custom view on res.users, containing only 3 custom fields. If I open this view with a dynamic acion (injects user id), it will throw an access error for internal users. If I give them write acces to res.users, it will work. But why does Odoo Preferences view work without write permission?

This is my action to open my custom view. It is called with a server action, this server action is referenced in the menu item.

def action_open_session_settings(self):
return {
'type': 'ir.actions.act_window',
'res_model': 'res.users',
'name': 'Session Settings',
'view_mode': 'form',
'view_id': self.env.ref('custom_module.view_sale_workflow_session_config_form').id,
'res_id': self.env.uid,
'target': 'new',
'context': {'create': 0},
}


Thank you in advance for your help!

Avatar
Descartar
Best Answer

Hello,

The Preference menu work is because it has access rules set into it. Those access rules are bound to the groups. If you activate the debug mode and open the "View Access Rights", you will see these rules

Hope this helps, best regards

Altela (altelasoftware.com)

Avatar
Descartar
Autor

Hi there, thank you for the quick response. I cannot see your image. I checked, and the access rules are exactly the same as on my custom view. So this does not answer my question yet.