Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

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

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
odooodoo 17Odoo 18
1 Balas
3215 Tampilan
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
Buang
Avatar
Christoph Farnleitner
Jawaban Terbai

base.user_groups_view replaces groups_id

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Odoo 17 & 18 enhancements
odoo 17 Odoo 18
Avatar
Avatar
1
Des 24
5446
Migrate database Odoo V17 to V18.
database migration odoo 17 Odoo 18
Avatar
Avatar
1
Jan 25
2693
(!!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
Okt 25
599
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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