From bf32edab232b88cb6c5989d1ee7092b0384ad80e Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Mon, 16 Sep 2024 15:42:58 +0200 Subject: [PATCH] [FIX] spreadsheet_oca: Show the "Add" button in invoice list If any module males a primary template from the ones where the button is added, the button wasn't be shown previously. That's because the inheritance and load order works in OWL. The way to fix this is to make this load order deterministic specifying to be loaded after the corresponding template for being taken into account for primary views. This also required to split the templates file into several ones. --- spreadsheet_oca/__manifest__.py | 16 ++++++- .../src/spreadsheet/graph_controller.xml | 15 +++++++ .../src/spreadsheet/list_controller.xml | 16 +++++++ .../src/spreadsheet/pivot_controller.xml | 15 +++++++ .../static/src/spreadsheet/spreadsheet.xml | 45 ------------------- 5 files changed, 61 insertions(+), 46 deletions(-) create mode 100644 spreadsheet_oca/static/src/spreadsheet/graph_controller.xml create mode 100644 spreadsheet_oca/static/src/spreadsheet/list_controller.xml create mode 100644 spreadsheet_oca/static/src/spreadsheet/pivot_controller.xml delete mode 100644 spreadsheet_oca/static/src/spreadsheet/spreadsheet.xml diff --git a/spreadsheet_oca/__manifest__.py b/spreadsheet_oca/__manifest__.py index d3554204..7944f73d 100644 --- a/spreadsheet_oca/__manifest__.py +++ b/spreadsheet_oca/__manifest__.py @@ -22,12 +22,26 @@ "assets": { "web.assets_backend": [ "spreadsheet_oca/static/src/spreadsheet/spreadsheet.scss", - "spreadsheet_oca/static/src/spreadsheet/spreadsheet.xml", "spreadsheet_oca/static/src/spreadsheet/spreadsheet_action.esm.js", "spreadsheet_oca/static/src/spreadsheet/pivot_controller.esm.js", "spreadsheet_oca/static/src/spreadsheet/graph_controller.esm.js", "spreadsheet_oca/static/src/spreadsheet/list_controller.esm.js", "spreadsheet_oca/static/src/spreadsheet/list_renderer.esm.js", + ( + "after", + "web/static/src/views/graph/graph_controller.xml", + "spreadsheet_oca/static/src/spreadsheet/graph_controller.xml", + ), + ( + "after", + "web/static/src/views/list/list_controller.xml", + "spreadsheet_oca/static/src/spreadsheet/list_controller.xml", + ), + ( + "after", + "web/static/src/views/pivot/pivot_controller.xml", + "spreadsheet_oca/static/src/spreadsheet/pivot_controller.xml", + ), ], "spreadsheet.o_spreadsheet": [ "spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml", diff --git a/spreadsheet_oca/static/src/spreadsheet/graph_controller.xml b/spreadsheet_oca/static/src/spreadsheet/graph_controller.xml new file mode 100644 index 00000000..ce1b5ac1 --- /dev/null +++ b/spreadsheet_oca/static/src/spreadsheet/graph_controller.xml @@ -0,0 +1,15 @@ + + + + +