From a86d4edb8977faa34d43c3649c79bbbaa7521171 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 31 Aug 2022 09:20:12 +0000 Subject: [PATCH] [FIX] web: grouped list: support buttons in between aggregates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the list view crashed when it was grouped if there was a button column in between two "aggregatable" fields columns. The reason is that "formatAggragatableValue" makes sense only on field columns, and it crashes when called on a column of another type. It was for instance the case in the Stock > Locations list view. closes odoo/odoo#99289 Signed-off-by: Georis François (fge) --- .../static/src/views/list/list_renderer.xml | 4 +- .../web/static/tests/views/list_view_tests.js | 60 +++++++++++++------ 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/addons/web/static/src/views/list/list_renderer.xml b/addons/web/static/src/views/list/list_renderer.xml index f7fcec16f11..1a3191e672f 100644 --- a/addons/web/static/src/views/list/list_renderer.xml +++ b/addons/web/static/src/views/list/list_renderer.xml @@ -170,8 +170,8 @@ - - + + diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index 6cdf73f9fa4..b5ebd1cb9ed 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -2740,6 +2740,25 @@ QUnit.module("Views", (hooks) => { ); }); + QUnit.test("aggregates in grouped lists with buttons", async function (assert) { + await makeView({ + type: "list", + resModel: "foo", + serverData, + groupBy: ["m2o"], + arch: ` + + + +