Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
2 Replies
7719 Views
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
Discard
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
Discard
Cruz
Author

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
Discard
Cruz
Author

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
Author

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
Author

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
Author

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!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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