Skip to content

[FIX] account_analytic_tag: fix broken xpaths for Odoo 19 view structure#901

Open
digiter-tw wants to merge 1 commit into
OCA:19.0from
digiter-tw:19.0-fix-account-analytic-tag-odoo19-views
Open

[FIX] account_analytic_tag: fix broken xpaths for Odoo 19 view structure#901
digiter-tw wants to merge 1 commit into
OCA:19.0from
digiter-tw:19.0-fix-account-analytic-tag-odoo19-views

Conversation

@digiter-tw

Copy link
Copy Markdown

Summary

Two breaking view structure changes in Odoo 19 prevent account_analytic_tag from installing:

1. invoice_line_ids list element renamed

The <list> inside invoice_line_ids was given name="journal_items" in Odoo 19.
The xpath must match list[@name='journal_items'] instead of bare list.

2. line_ids renamed to journal_line_ids

The Journal Items tab field was renamed from line_ids to journal_line_ids in Odoo 19.

Changes

  • account_analytic_tag/views/account_move_views.xml: update two xpaths to match Odoo 19 view structure

Test

Verified on Odoo 19.0 Community — module installs and analytic_tag_ids column appears correctly in both Invoice Lines and Journal Items tabs.

In Odoo 19, two breaking changes affect the account.move form view:
- invoice_line_ids list element was given name="journal_items", so the
  xpath must match list[@name='journal_items'] instead of list
- line_ids was renamed to journal_line_ids (Journal Items tab)

Fixes installation on Odoo 19 Community.
@OCA-git-bot OCA-git-bot added series:19.0 mod:account_analytic_tag Module account_analytic_tag labels Apr 25, 2026
@pedrobaeza pedrobaeza added this to the 19.0 milestone Apr 27, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

I don't get the changes. They were correct AFAIK.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @digiter-tw, thanks for the contribution!

After checking the Odoo 19 source code, the original xpaths are correct:

  • invoice_line_ids: XPath list/field[...] matches any <list> regardless of its name attribute, so no fix is needed here. source
  • line_ids: The view still uses line_ids, not journal_line_ids. That field exists in the model but is marked as deprecated and unused in views. Changing the xpath actually breaks the installation — confirmed on runboat:
Element '<xpath expr="//field[@name=&#39;journal_line_ids&#39;]/list/field[@name=&#39;analytic_distribution&#39;]">' cannot be located in parent view

View error context:
{'file': '/mnt/data/odoo-addons-dir/account_analytic_tag/views/account_move_views.xml',
 'line': 1,
 'name': 'account.move.tag_ids.form.inherit',
 'view': ir.ui.view(861,),
 'view.model': 'account.move',
 'view.parent': ir.ui.view(709,),
 'xmlid': 'account_move_analytic_tag_ids_form'}

The changes are not necessary and the current code in 19 version is correct as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_analytic_tag Module account_analytic_tag series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants