WeblixTools
Runs in Your Browser • Built for Odoo Developers

XML XPath Tester & Odoo XPath Generator

Paste XML or an Odoo view into the XPath tester to see every match highlighted in the source, and click any tag to get its XPath and a ready-to-paste inherited-view snippet.

XPATH
0 matches
Loading editor…
XML55 linesXPath 1.0 + Odoo hasclass() · runs in your browser

Safe by design

Scripts in pages you load or paste never run, and nothing is stored.

Fast, no sign-up

No account and no daily limit for normal use.

Built for developers

Made for scraping, testing, SEO checks and front-end work.

Test XPath on XML and write Odoo view inheritance faster

Type an XPath and every matching tag is highlighted in the source, while XML syntax errors are reported with the exact line. Click inside any tag to get an XPath that's unique inside the view's arch, such as //field[@name='partner_id'], then pick a position and copy an <xpath> block, the <field> shorthand or a complete inherited ir.ui.view record.

How to use it

  1. 1Paste your XML or Odoo view, or press Sample to try an Odoo sale.order form.
  2. 2Type an XPath expression and watch the matches light up in the source.
  3. 3Click inside the tag you want to change to generate its XPath.
  4. 4Pick a position and copy the <xpath> snippet or full inherited record into your module.

The five positions and when to use each

Odoo can also move an existing element: put <field name="..." position="move"/> inside an xpath that points to the new spot. The generator doesn't write that one, but you can test both expressions here first.

  • after and before: add a field or button next to the match. Most inherited views need nothing more.
  • inside: add content as the last child of the match, for example a new page at the end of a notebook. Odoo uses it when position is left out.
  • attributes: change the match without touching its structure, such as making a field invisible or required. The snippet starts you off with <attribute name="invisible">state != 'draft'</attribute>.
  • replace: swap the element for your content, or remove it with an empty body. Other modules may target the same element, so hiding it with attributes is usually the safer choice.

When Odoo can't locate the element

An upgrade that stops with "cannot be located in parent view" means the expression matched nothing in the view as Odoo built it. The usual reasons: another module already removed or renamed the element, the field lives in the form view but you're inheriting the list view, or the parent view changed between Odoo versions.

Copy the parent's current arch from Settings → Technical → Views (developer mode) and test the expression against it here. If other installed modules inherit the same view, check their changes too, since they're applied before yours when their priority is lower.

XPath for sitemaps, feeds and other XML

  • Sitemaps: count(//url) tells you how many addresses one lists, and //url[not(lastmod)]/loc finds the ones without a date.
  • RSS has no default namespace, so //item/title lists every headline as it stands.
  • Atom feeds and SVG files declare one. Keep Ignore default namespace ticked and //entry/title or //path work as written.

Related tools

Reviews

What Our Users Say

Real feedback from people using WeblixTools, checked by our team before it appears.

Frequently Asked Questions

How do I find the right XPath for an Odoo inherited view?

Paste the parent view (from the source code or Settings → Technical → Views), click inside the element you want to extend, and copy the generated Odoo XPath. It prefers stable attributes such as name, and checks that the expression matches only one element inside the view's arch, because Odoo applies the first match.

Does it support Odoo's hasclass() function?

Yes. Expressions such as //div[hasclass('oe_title')] or //button[hasclass('btn-primary', 'o_form_button')] are converted to the equivalent standard XPath, so you can test them exactly as you would write them in a view.

Which Odoo versions does it work with?

Any version. View inheritance with xpath expr and position has worked the same way for years. The sample uses current syntax (list views and the chatter tag); for Odoo 16 and older, use tree instead of list in your expressions.

Why does //url match nothing in my sitemap?

Sitemaps, SVG and SOAP documents declare a default namespace, which normally hides elements from plain XPath. Keep "Ignore default namespace" ticked and //url/loc works as expected. Prefixed names such as //image:loc are resolved from the document's own declarations.

Is my XML uploaded?

No. Pasted text and opened files are parsed in your browser only. When you use Load from URL, our server fetches that address for you and sends it back without storing it.

See all FAQs →