Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Issue with Locating groups_id Field in base.view_users_form for Odoo 17 and 18

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
odooodoo 17Odoo 18
1 Responder
3226 Vistas
Avatar
red moon

Hello,

I am encountering a persistent validation error while trying to customize the res.users form view in my custom module for Odoo 17 and 18. The error message is:

Validation Error
Error while parsing or validating view:
Element '<xpath expr="//field[@name='groups_id']">' cannot be located in parent view

Details:

  • I am attempting to inherit the base.view_users_form view to manage user types (e.g., Seller, Customer) for each user, specifically within the Access Rights tab of the user form. My goal is to ensure that each user has only one user type per page, avoiding the "The user cannot have more than one user types" error.
  • The XPath expression //field[@name='groups_id'] is intended to target the existing groups_id field to customize the selection of user types, but it fails to locate it in the parent view.


Parent View Structure (base.view_users_form):

The groups_id field is located within <page name="access_rights"> in the notebook, as shown below:



  • <page name="access_rights" string="Access Rights">
        <group string="Multi Companies" invisible="companies_count <= 1">
            <field string="Allowed Companies" name="company_ids" widget="many2many_tags" options="{'no_create': True, 'color_field': 'color'}"/>
            <field string="Default Company" name="company_id" context="{'user_preference': 0}"/>
            <field string="Companies count" name="companies_count" invisible="1"/>
        </group>
        <field name="groups_id"/>
    </page>
  • Despite this, the XPath fails, suggesting the field might not be directly accessible or its context has changed in Odoo 17/18.
  • Attempts Made:
    • Used //page[@name='access_rights']/field[@name='groups_id'] and //page[@name='access_rights'] to target the field, but the error persists.
    • Disabled manual group selection in the upper User types? section by setting invisible="1" on groups_id, but the issue remains when saving the form, especially when switching between user types per user page.

Custom View Code:

<record id="view_users_form_inherit_seller" model="ir.ui.view">
    <field name="name">res.users.form.inherit.seller</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='groups_id']" position="attributes">
            <attribute name="invisible">1</attribute>
        </xpath>
        <xpath expr="//page[@name='access_rights']" position="inside">
            <group name="user_type_group" string="User Type">
                <field name="groups_id" widget="radio" options="{'horizontal': true}" groups="base.group_system"
                       domain="[('category_id.name', '=', 'User types')]"
                       nolabel="1"/>
                <field name="user_type" widget="selection" options="{'no_create': True}" groups="base.group_system">
                    <option value="customer">Customer</option>
                    <option value="seller">Marketplace Seller</option>
                </field>
            </group>
        </xpath>
    </field>
</record>

Questions:

  1. Has the structure or accessibility of the groups_id field changed in Odoo 17 or 18, making it unavailable for inheritance with the specified XPath to manage user types per user page?
  2. Is there a recommended way to override or extend the groups_id field to enforce a single user type selection per user page without this error?

Any guidance, updated XPath syntax, or confirmation of a potential bug would be greatly appreciated. Thank you!

Any guidance  or updated XPath syntax Thank you!

Odoo Version: 17 and 18​

1
Avatar
Descartar
Avatar
Christoph Farnleitner
Mejor respuesta

base.user_groups_view replaces groups_id

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 17 & 18 enhancements
odoo 17 Odoo 18
Avatar
Avatar
1
dic 24
5448
Migrate database Odoo V17 to V18.
database migration odoo 17 Odoo 18
Avatar
Avatar
1
ene 25
2695
(!!C-o-p-a!!)¿Cómo comunicarse con Copa Airlines en Panamá?
odoo
Avatar
0
nov 25
211
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
nov 25
3328
How to Delete a Stale Project Folder?
Odoo 18
Avatar
Avatar
2
oct 25
606
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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