From 39b66a62755c1993a40031b9ee5de4141b5c916f Mon Sep 17 00:00:00 2001 From: Derek Loewen Date: Tue, 13 Oct 2026 14:20:26 -0500 Subject: [PATCH] [IMP] web_tree_many2one_clickable: support document lines 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. --- web_tree_many2one_clickable/README.rst | 5 ++--- web_tree_many2one_clickable/__manifest__.py | 12 ++++++++++-- web_tree_many2one_clickable/readme/DESCRIPTION.md | 2 ++ web_tree_many2one_clickable/readme/ROADMAP.md | 3 --- .../static/description/index.html | 3 +-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/web_tree_many2one_clickable/README.rst b/web_tree_many2one_clickable/README.rst index c1ca8c08b512..ccab82669467 100644 --- a/web_tree_many2one_clickable/README.rst +++ b/web_tree_many2one_clickable/README.rst @@ -36,6 +36,8 @@ This addon forces Odoo to use many2one widget on a many2one fields in tree views. This allows users to open linked resources from trees directly, using a button without accessing the form. +This also works in the lines of sales, purchases and invoices. + **Table of contents** .. contents:: @@ -63,9 +65,6 @@ This widget is currently not working on the product field in the lines tree of the sale order form, see https://github.com/OCA/web/pull/1438 for further details. -To add this functionality to lines of sales, purchases and invoices, as -they are special views, is required a glue module that add this feature. - Bug Tracker =========== diff --git a/web_tree_many2one_clickable/__manifest__.py b/web_tree_many2one_clickable/__manifest__.py index cd701a728dda..2585a8a60470 100644 --- a/web_tree_many2one_clickable/__manifest__.py +++ b/web_tree_many2one_clickable/__manifest__.py @@ -25,8 +25,16 @@ "many2one_button/many2one_button.esm.js", "web_tree_many2one_clickable/static/src/components/" "many2one_button/many2one_button.scss", - "web_tree_many2one_clickable/static/src/components/" - "many2one_button/many2one_button.xml", + # Load right after the list renderer templates so the extension is + # inherited by list renderers that use their own primary record row + # template, such as the section and note lists of invoice, sale and + # purchase lines + ( + "after", + "web/static/src/views/list/list_renderer.xml", + "web_tree_many2one_clickable/static/src/components/" + "many2one_button/many2one_button.xml", + ), ] }, } diff --git a/web_tree_many2one_clickable/readme/DESCRIPTION.md b/web_tree_many2one_clickable/readme/DESCRIPTION.md index 8e07ea67a567..85f237edffbc 100644 --- a/web_tree_many2one_clickable/readme/DESCRIPTION.md +++ b/web_tree_many2one_clickable/readme/DESCRIPTION.md @@ -1,3 +1,5 @@ This addon forces Odoo to use many2one widget on a many2one fields in tree views. This allows users to open linked resources from trees directly, using a button without accessing the form. + +This also works in the lines of sales, purchases and invoices. diff --git a/web_tree_many2one_clickable/readme/ROADMAP.md b/web_tree_many2one_clickable/readme/ROADMAP.md index e24c53c65faf..1edf5bdd727b 100644 --- a/web_tree_many2one_clickable/readme/ROADMAP.md +++ b/web_tree_many2one_clickable/readme/ROADMAP.md @@ -1,6 +1,3 @@ This widget is currently not working on the product field in the lines tree of the sale order form, see for further details. - -To add this functionality to lines of sales, purchases and invoices, as -they are special views, is required a glue module that add this feature. diff --git a/web_tree_many2one_clickable/static/description/index.html b/web_tree_many2one_clickable/static/description/index.html index 4fefd83ab241..ef032a3f632b 100644 --- a/web_tree_many2one_clickable/static/description/index.html +++ b/web_tree_many2one_clickable/static/description/index.html @@ -378,6 +378,7 @@

Clickable many2one fields for tree views

This addon forces Odoo to use many2one widget on a many2one fields in tree views. This allows users to open linked resources from trees directly, using a button without accessing the form.

+

This also works in the lines of sales, purchases and invoices.

Table of contents

    @@ -408,8 +409,6 @@

    Known issues / Roadmap

    This widget is currently not working on the product field in the lines tree of the sale order form, see https://github.com/OCA/web/pull/1438 for further details.

    -

    To add this functionality to lines of sales, purchases and invoices, as -they are special views, is required a glue module that add this feature.