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[@data-key=&#39;hr&#39;]//div[hasclass(&#39;o_settings_container&#39;)]">' cannot be located in parent view of Odoo17

Subscriure's

Get notified when there's activity on this post

This question has been flagged
3 Respostes
5638 Vistes
Avatar
Cruz

Seeking guidance on how to fix the below error. Any suggestions?

Traceback (most recent call last): File "/opt/odoo17/odoo/odoo/http.py", line 1722, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/opt/odoo17/odoo/odoo/service/model.py", line 133, in retrying result = func() File "/opt/odoo17/odoo/odoo/http.py", line 1749, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/opt/odoo17/odoo/odoo/http.py", line 1953, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/opt/odoo17/odoo/addons/website/models/ir_http.py", line 235, in _dispatch response = super()._dispatch(endpoint) File "/opt/odoo17/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch result = endpoint(**request.params) File "/opt/odoo17/odoo/odoo/http.py", line 722, in route_wrapper result = endpoint(self, *args, **params_ok) File "/opt/odoo17/odoo/addons/web/controllers/dataset.py", line 28, in call_button action = self._call_kw(model, method, args, kwargs) File "/opt/odoo17/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo17/odoo/odoo/api.py", line 466, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/opt/odoo17/odoo/odoo/api.py", line 453, in _call_kw_multi result = method(recs, *args, **kwargs) File "", line 2, in button_immediate_install File "/opt/odoo17/odoo/odoo/addons/base/models/ir_module.py", line 75, in check_and_log return method(self, *args, **kwargs) File "/opt/odoo17/odoo/odoo/addons/base/models/ir_module.py", line 459, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/opt/odoo17/odoo/odoo/addons/base/models/ir_module.py", line 583, in _button_immediate_function registry = modules.registry.Registry.new(self._cr.dbname, update_module=True) File "", line 2, in new File "/opt/odoo17/odoo/odoo/tools/func.py", line 87, in locked return func(inst, *args, **kwargs) File "/opt/odoo17/odoo/odoo/modules/registry.py", line 113, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/opt/odoo17/odoo/odoo/modules/loading.py", line 480, in load_modules processed_modules += load_marked_modules(env, graph, File "/opt/odoo17/odoo/odoo/modules/loading.py", line 364, in load_marked_modules loaded, processed = load_module_graph( File "/opt/odoo17/odoo/odoo/modules/loading.py", line 227, in load_module_graph load_data(env, idref, mode, kind='data', package=package) File "/opt/odoo17/odoo/odoo/modules/loading.py", line 71, in load_data tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind) File "/opt/odoo17/odoo/odoo/tools/convert.py", line 627, in convert_file convert_xml_import(env, module, fp, idref, mode, noupdate) File "/opt/odoo17/odoo/odoo/tools/convert.py", line 693, in convert_xml_import obj.parse(doc.getroot()) File "/opt/odoo17/odoo/odoo/tools/convert.py", line 613, in parse self._tag_root(de) File "/opt/odoo17/odoo/odoo/tools/convert.py", line 567, in _tag_root 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_employee_updation/views/updation_config.xml:3 Error while parsing or validating view: Element '' cannot be located in parent view View error context: {'file': '/opt/odoo17/odoo/addons/gb_hr_employee_updation/views/updation_config.xml', 'line': 2, 'name': 'journal.res.config.settings.view.form.inherit.hr.fleet', 'view': ir.ui.view(3798,), 'view.model': 'res.config.settings', 'view.parent': ir.ui.view(176,), 'xmlid': 'journal_config_settings_view_form'}


0
Avatar
Descartar
Avatar
Cruz
Autor Best Answer

I just solved it, by changing the code to
<xpath expr="//form" position="inside">
Now it is working fine.

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>


The above is just an example, please provide your correct settings id in Xpath


Hope it helps

0
Avatar
Descartar
Cruz
Autor

I just solved it, by changing the code to
<xpath expr="//form" position="inside">
Now it is working fine.

Avatar
Vikas Jadav
Best Answer


Hello,

Try following code instead.

Mark it as answer or upvote if it's helpful, Thanks.


field name="arch" type="xml">

    xpath expr="//block[@name='employees_setting_container']" position="after">

        block title="block_title" id="block_id">

            setting string="Custom Setting" id="setting_id" title="your title.">

                field name="field_name"/>

            /setting>

        /block>

    /xpath>

/field>

0
Avatar
Descartar
Cruz
Autor

Hi Vikas,
I was not able to view your code

Vikas Jadav

Updated it.
I think odoo does not let me add < so removed it.

Cruz
Autor

Okay Vikas, now the code is visible. But my existing code is below.

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="journal_config_settings_view_form" model="ir.ui.view">
<field name="name">journal.res.config.settings.view.form.inherit.hr.fleet</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="90"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='hr']//div[hasclass('o_settings_container')]" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="notice_period"/>
</div>
<div class="o_setting_right_pane">
<label for="notice_period"/>
<div class="content-group" attrs="{'invisible': [('notice_period', '=', False)]}">
<div class="mt16">
<field name="no_of_days" style="width:50px;"/>
<span>days</span>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
So how can i change this code in accordance with yours.

Cruz
Autor

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="journal_config_settings_view_form" model="ir.ui.view">
<field name="name">journal.res.config.settings.view.form.inherit.hr.fleet</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="90"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='hr']//div[hasclass('o_settings_container')]" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="notice_period"/>
</div>
<div class="o_setting_right_pane">
<label for="notice_period"/>
<div class="content-group" attrs="{'invisible': [('notice_period', '=', False)]}">
<div class="mt16">
<field name="no_of_days" style="width:50px;"/>
<span>days</span>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

What adjustments should be made to this code to fix the error?

Vikas Jadav


<record id="journal_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hr.fleet</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="hr.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//block[@name='employees_setting_container']" position="after">
<block title="Contract" id="hr_contract">
<setting string="Notice Period" id="notice_period_setting">
<div class="content-group">
<div class="mt16">
<label string="Notice Period" for="notice_period" class="o_light_label"/>
</div>
<div>
<field name="notice_period"/>
<span>Days</span>
</div>
</div>
</setting>
</block>
</xpath>
</field>
</record>

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