From ce30c50e8d8fcdb8ebc150fe79ba7b571e1d56af Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Fri, 25 Nov 2022 14:50:57 +0000 Subject: [PATCH] [IMP] web: add buttons in control panel without selection in list This commit adds the possibility to define buttons that are always present in the arch of a list view. Purpose: Several customisations of the list view consist in adding an always present button in the control panel that performs an action/calls a model's method. We want to support this feature directly in the framework to remove these customisations. Solution: Add a "display" option that lets you know when to display a button. The different values that can be assigned to "display": - "selection": the button is only displayed if at least one record is selected. - "always": the button is always displayed. The default value of "display" is "selection". Exemple:
Taskid: 3082303 Part-of: odoo/odoo#106519 --- .../static/src/views/list/list_controller.xml | 16 +++--- addons/web/static/src/views/utils.js | 1 + .../web/static/tests/views/list_view_tests.js | 50 ++++++++++++++++++- odoo/addons/base/rng/common.rng | 1 + 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/addons/web/static/src/views/list/list_controller.xml b/addons/web/static/src/views/list/list_controller.xml index ec1abdd8f9b..321acc1b399 100644 --- a/addons/web/static/src/views/list/list_controller.xml +++ b/addons/web/static/src/views/list/list_controller.xml @@ -47,26 +47,26 @@ Create - -