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
    • Validacions
    • 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ó
    • Gestió immobiliària
    • 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

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
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

Element '<xpath expr="//div[hasclass(&#39;settings&#39;)]">' cannot be located in parent view in Odoo17

Subscriure's

Get notified when there's activity on this post

This question has been flagged
2 Respostes
7646 Vistes
Avatar
Cruz


Having moved the code from odoo16 to odoo17, I ran into the following error.

raise ParseError(msg) from None  # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
odoo.tools.convert.ParseError: while parsing /opt/odoo17/odoo/addons/gb_hr_payroll_community/views/res_config_settings_views.xml:11
Error while parsing or validating view:

Element '' cannot be located in parent view

View error context:
{'file': '/opt/odoo17/odoo/addons/gb_hr_payroll_community/views/res_config_settings_views.xml',
 'line': 2,
 'name': 'res.config.settings.view.form.inherit.hr.payroll',
 'view': ir.ui.view(3364,),
 'view.model': 'res.config.settings',
 'view.parent': ir.ui.view(176,),
 'xmlid': 'res_config_settings_view_form_payroll'}                   

What steps should I follow to fix this?

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

Hi,

In odoo 17 there is so many changes had occurred inside res config settings. So make clear that you are xpathing the correct location

example:

<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
        <field name="inherit_id"
ref="base_setup.res_config_settings_view_form"/>
        <field name="arch" type="xml">
<xpath expr="//setting[@id='mail_templates_setting']"
                   position="after">
                <setting id="company_share_product"
                         string="Inter Company features"
                         help="Automatically generate counterpart documents for orders/invoices between companies "
                         company_dependent="1">
                    <div class="content-group">
                        <div class="mt16">
                            <field name="company_share_product"/>
                            <label string="Common Product Catalog"
                                   for="company_share_product" class="o_light_label"/>
                        </div>
                    </div>
                </setting>

       </xpath>

</field>

</record>


Hope it helps

0
Avatar
Descartar
Cruz
Autor

Now it showing

raise ParseError(msg) from None # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
odoo.tools.convert.ParseError: while parsing /opt/odoo17/odoo/addons/gb_hr_payroll_community/views/res_config_settings_views.xml:11
Since 17.0, the "attrs" and "states" attributes are no longer used.
View: res.config.settings.view.form.inherit.hr.payroll in gb_hr_payroll_community/views/res_config_settings_views.xml

View error context:
{'name': 'invalid view'}

Code:

<h2 attrs="{'invisible': ['|', '|', ('module_l10n_fr_hr_payroll', '=', True), ('module_l10n_be_hr_payroll', '=', True), ('module_l10n_in_hr_payroll', '=', True)]}">Payroll</h2>

Avatar
Jaiswal Shivam
Best Answer

Try this

0
Avatar
Descartar
Cruz
Autor

Now it shows new error.

raise ParseError(msg) from None # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
odoo.tools.convert.ParseError: while parsing /opt/odoo17/odoo/addons/gb_hr_payroll_community/views/res_config_settings_views.xml:11
Invalid Expression while parsing xpath "//setting[@id='display_payslip]"

View error context:
'-no context-'

Cruz
Autor

Sorry, later I just added the hr_payroll in depends. Now it shows new error.

You try to install module 'gb_hr_payroll_community' that depends on module 'hr_payroll'.
But the latter module is not available in your system.

Jaiswal Shivam

Hello Cruz

//setting[@id='display_payslip]" replace with this --> //setting[@id='display_payslip']"

--You have not used ' in above code after payslip

Do step 1:- install hr_payroll first and then install your module

​Step 2 :- Install your module through terminal using -i 'Your module name' if you doing it locally

Thanks

Cruz
Autor

Hi Jaiswal,
I couldn't find hr_payroll module in odoo17.

Jaiswal Shivam

hi Cruz
because payroll is not available in community version I have written above code for odoo17 enterprise version

You can prefer above Cybrosys Techno Solutions Pvt.Ltd's Solution

Thanks

Cruz
Autor

Ok Jaiswal. Thank you for spending your valuable time.

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
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 ภาษาไทย 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