Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Adding a field to the res.users form view

Subscriure's

Get notified when there's activity on this post

This question has been flagged
settingsusersodoo18
4 Respostes
468 Vistes
Avatar
samual

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

0
Avatar
Descartar
Avatar
samual
Autor Best Answer

Well somehow someway adding this arguement to the field definition made it appear in the user form
website_form_blacklisted=False

0
Avatar
Descartar
Avatar
Zehntech Technologies Inc.
Best Answer

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.

santosh.sekwadia@zehntech.com

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
Hi,

If the field is correctly added to res.users but does not appear in the Access Rights tab, you may be inheriting the wrong view. The user form displayed under Settings → Users & Companies → Users is usually based on the view base.view_users_form. Also, some sections of the user form are restricted by groups, so ensure your user has sufficient access rights.

For example, you can add a custom field as follows:

Python

from odoo import models, fields

class ResUsers(models.Model):
_inherit = 'res.users'

employee_code = fields.Char(string="Employee Code")

XML

<record id="view_users_form_inherit" model="ir.ui.view">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">

<xpath expr="//page[@name='access_rights']/group" position="inside">
<field name="employee_code"/>
</xpath>

</field>
</record>


After adding the field, upgrade your module and activate Developer Mode. Then go to Settings → Technical → User Interface → Views and verify that your inherited view is applied correctly.

If the field still does not appear, inspect the final generated view using Developer Mode → Edit View: Form and confirm that:

    The field exists in res.users.
    Your inherited view is active.
    The XPath matches an element that exists in your Odoo version.
    No groups or attrs conditions are hiding the field.

The exact XPath may vary depending on the Odoo version, so checking the structure of base.view_users_form in Developer Mode is often the quickest way to identify the correct insertion point.

Hope it helps

0
Avatar
Descartar
Avatar
Muhammad Farooq Iqbal
Best Answer

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:

  1. Make sure you are inheriting the correct user form view, usually:

base.view_users_form
  1. Make sure your module depends on base and any module that adds the tab you are trying to inherit.

  2. 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>
  1. 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.

  2. Also make sure the field has proper access rights. Since res.users is security-sensitive, visibility can be affected by groups.

  3. 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.

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Technical User Settings > Odoo V14
settings users v14
Avatar
Avatar
Avatar
2
de febr. 24
4702
Configure user's rights to modify General setting
settings users v7
Avatar
Avatar
2
de des. 19
13883
Administrator rights, User editing rights
settings users v7
Avatar
Avatar
1
de set. 16
16388
Odoo user error how to fix? Solved
settings users odoo8
Avatar
Avatar
Avatar
3
de maig 16
6210
Creating a Readonly User Group in Odoo Without Code Modifications Solved
settings users groups access rights
Avatar
Avatar
2
de gen. 25
4200
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now