From 15f2d75bdb48190a8bf25cf2bf70ed72eab72ac7 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 11 Jul 2022 08:20:42 +0000 Subject: [PATCH] [IMP] web: add className getter in list view Before this commit, the kanban view has a `className` getter to easily add a class if needed. The list view only uses the className given in the props and so className is added in the view. This commit adds a className getter to be consistent with kanban view and to allow to easily add a className to a specific case (that is for an eventual customization). task-2713538 Part-of: odoo/odoo#98380 --- addons/web/static/src/views/list/list_controller.js | 4 ++++ addons/web/static/src/views/list/list_controller.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/views/list/list_controller.js b/addons/web/static/src/views/list/list_controller.js index e2b8655e1b7..d358b70e5d3 100644 --- a/addons/web/static/src/views/list/list_controller.js +++ b/addons/web/static/src/views/list/list_controller.js @@ -279,6 +279,10 @@ export class ListController extends Component { } } + get className() { + return this.props.className; + } + get nbSelected() { return this.model.root.selection.length; } diff --git a/addons/web/static/src/views/list/list_controller.xml b/addons/web/static/src/views/list/list_controller.xml index 5e0020739e3..d4e123dbad9 100644 --- a/addons/web/static/src/views/list/list_controller.xml +++ b/addons/web/static/src/views/list/list_controller.xml @@ -2,7 +2,7 @@ -
+