Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Element '<xpath expr="//div[@data-key=&#39;hr&#39;]//div[hasclass(&#39;o_settings_container&#39;)]">' cannot be located in parent view of Odoo17

Odoberať

Get notified when there's activity on this post

This question has been flagged
3 Replies
5680 Zobrazenia
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
Zrušiť
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
Zrušiť
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
Zrušiť
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
Zrušiť
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!

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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