I am encountering an access error in Odoo when changing a user’s fleet permissions to anything other than Administrator. Specifically, I get the following error while opening the user’s profile:
Access Error
- employee_cars_count (allowed for groups 'Fleet / Administrator')
or')
I need users to view their own profiles without requiring any fleet permissions. Has anyone experienced this issue and found a solution?
I discovered that this error is related to the hr_fleet module and is triggered when I extend the user profile form. Here is the XML code that causes the issue:
from odoo import fields, models
class MSResUsers(models.Model):
_inherit = 'res.users'
microsoft_outlook_uri_incoming = fields.Char(compute='_compute_incoming', string='Outgoing token',
help='The URL to generate the authorization code from Outlook')
def _compute_incoming(self):
pass
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="res_users_view_form_outlook123" model="ir.ui.view">
<field name="name">res.users.preferences.form.inherit123</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='signature']" position="after">
<field name="microsoft_outlook_uri_incoming"/>
</xpath>
</field>
</record>
</data>
</odoo>
I am curious as to why adding a simple field like this triggers the access error. Any insights or solutions would be much appreciated.
Thank you!
I tried creating custom extension with simple field, adding this field to user profile.
After adding simple field, suddenly exception Access Error was raised.