Hello odooers.
i added a field to the res.users model/table in python and then extended the res.users form view to add that field to the view.
but when i access the users form view via settings the field is no where to be found is there a different way of adding fields to the user form view in odo?
its not the first time i extend view and add fields to them i did this alot before but here it doesnt seem to work.
i am trying to add the new field inside the access_rights tab
Deze vraag is gerapporteerd
Well somehow someway adding this arguement to the field definition made it appear in the user form
website_form_blacklisted=False
Hello,
Yes, it is possible to add custom fields to the res.users form view in Odoo.
The first thing to verify is that you are inheriting the correct User form view, as res.users has multiple inherited views and some sections (including Access Rights) may be modified by other modules. Also check:
- The field is added to the res.users model (not res.partner by mistake).
- The inherited view is applied successfully without XML errors.
- The field is inserted at the correct XPath location within the Access Rights tab.
- Any groups, attrs, or visibility conditions are not hiding the field.
A good troubleshooting step is to activate Developer Mode and inspect the final combined form view to confirm whether your field is being injected into the view architecture.
Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion.
Regards,
Zehntech Technologies Inc.
Hope it helps
Hi,
Yes, res.users is a bit special compared to normal models.
The user form opened from Settings > Users & Companies > Users is usually not a simple single form view. Odoo has different inherited views for users, especially for access rights/preferences, and the Access Rights tab is dynamically handled with groups/security-related content.
So if your field is added to res.users correctly but does not appear, check these points:
Make sure you are inheriting the correct user form view, usually:
base.view_users_form
Make sure your module depends on base and any module that adds the tab you are trying to inherit.
The access_rights tab may be modified dynamically, so try adding your field to another stable place first, such as after the login/email field, to confirm the field and view inheritance are working.
Example:
<record id="view_users_form_inherit_custom" model="ir.ui.view">
<field name="name">res.users.form.inherit.custom</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='login']" position="after">
<field name="your_field_name"/>
</xpath>
</field>
</record>
If you specifically want to place it inside the Access Rights tab, inspect the final view in developer mode and confirm the exact XPath. The page name may not be the same as what you expect.
Also make sure the field has proper access rights. Since res.users is security-sensitive, visibility can be affected by groups.
Upgrade your custom module after changing Python/XML:
./odoo-bin -d your_db -u your_module
In short, adding fields to res.users is possible, but the Access Rights tab is special. First confirm the field appears in a stable location, then use developer mode to inspect the final inherited view and target the correct XPath inside the access rights page.
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden| Gerelateerde posts | Antwoorden | Weergaven | Activiteit | |
|---|---|---|---|---|
|
|
2
feb. 24
|
4701 | ||
|
|
2
dec. 19
|
13882 | ||
|
|
1
sep. 16
|
16380 | ||
|
Odoo user error how to fix?
Opgelost
|
|
3
mei 16
|
6208 | |
|
|
2
jan. 25
|
4200 |