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!