Skip to content

[19.0][IMP] web_tree_many2one_clickable: support document lines - #3739

Open
dloewen wants to merge 1 commit into
OCA:19.0from
dloewen:19.0-imp-web_tree_many2one_clickable-section_note
Open

dloewen wants to merge 1 commit into
OCA:19.0from
dloewen:19.0-imp-web_tree_many2one_clickable-section_note

Conversation

@dloewen

@dloewen dloewen commented Oct 19, 2026 •

Copy link
Copy Markdown

The clickable button does not show in the lines of invoices, sales and purchases, which the ROADMAP said needed a glue module.

Those lists use account.SectionAndNoteListRenderer.RecordRow (and sale.ListRenderer.RecordRow on top of it), a primary template inheriting web.ListRenderer.RecordRow. In 19.0 a primary template only inherits the extensions of its parent that were loaded before it, and this module's extension loads after account's templates.

This PR loads the template extension right after web/static/src/views/list/list_renderer.xml, the same approach as #3148 on 16.0. Every list renderer with its own primary record row template now gets the button, with no dependency on account and no glue module. The ROADMAP note about the glue module is removed. Fields displayed with a widget (like the product field) still don't get the button, as before.

This is in production use at one of our clients on 19.0.

How to test

On runboat (or any 19.0 database with account):

  1. With debug mode on, add an inherited view of account.view_move_form that shows the line partner column, which is already in the list but hidden:
      <xpath expr="//field[@name='invoice_line_ids']/list/field[@name='partner_id']" position="attributes">
        <attribute name="column_invisible">False</attribute>
      </xpath>
  2. Open an invoice and hover the Partner column of the lines: the button shows and opens the partner. Without this change, no button shows.
  3. Keep the Product column of the lines hidden: on runboat it currently crashes because of web_widget_product_label_section_and_note_full_label ([19.0] web_widget_product_label_section_and_note_full_label causes crash when opening invoice #3707), unrelated to this PR. If you can't open the invoice form view at all, reset your localStorage.

With sale installed, the same works on order lines, e.g. by adding after product_uom_qty in sale.view_order_form. Purchase lines behave the same way.

Tested on a clean 19.0 database with sale, in a headless browser:

List Before After
Invoice lines, partner_id no button 1 button, opens the partner
Sale order lines, order_partner_id no button 1 button, opens the partner
Contacts list, country_id button button (unchanged)

There is an open 20.0 migration of this module (#3693); this change can be carried forward there once merged.

@OCA-git-bot OCA-git-bot added series:19.0 mod:web_tree_many2one_clickable Module web_tree_many2one_clickable labels Oct 19, 2026
@pedrobaeza pedrobaeza added this to the 19.0 milestone Oct 19, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

I have just tried in runboat and seems to not work and give an error.

@dloewen

dloewen commented Oct 19, 2026

Copy link
Copy Markdown
Author

@pedrobaeza Thanks for testing! The error comes from web_widget_product_label_section_and_note_full_label, not from this module: its xpath on account.ProductLabelSectionAndNoteField no longer matches since odoo/odoo@21ee465 (props.readonly became this.labelIsReadonly). It's tracked in #3707 and happens on any 19.0 runboat when the invoice product column renders.

To see this PR's change on runboat: make the existing partner_id column of invoice_line_ids visible in account.view_move_form (it's there with column_invisible="True") and keep the product column hidden. The button then shows on the partner column of the lines and opens the partner. I'll update the test steps in the description too.

image image

@pedrobaeza

Copy link
Copy Markdown
Member

Please rebase now that the patch has been merged.

The button did not show in the lines of invoices, sales and purchases.
Their lists use a record row template that inherits the list renderer's
one as a primary template, and Odoo only passes on extensions loaded
before that template. Load the template extension right after the list
renderer's templates so these lists inherit it too, without a glue
module depending on account.
@dloewen
dloewen force-pushed the 19.0-imp-web_tree_many2one_clickable-section_note branch from 458bd27 to bf2eefb Compare October 20, 2026 15:52
@dloewen

dloewen commented Oct 20, 2026

Copy link
Copy Markdown
Author

@pedrobaeza Rebased, thanks!

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

Labels

mod:web_tree_many2one_clickable Module web_tree_many2one_clickable series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants