From e0109a99f87f5d9eabe024526491bd90750462e3 Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Thu, 4 Jan 2024 11:49:30 +0100 Subject: [PATCH] [FIX] web: header button with display="always" and invisible Since the commit odoo/odoo@0d99f4b9d9de404fea44ecf5480ec3b07c2b0fd6, the header buttons with display="always" can't be invisible. The invisible attribute is ignored for this type of button in list view and kanban view. This commit fixes this issue by adding t-if that will evaluate the invisible attribute. closes odoo/odoo#148092 Signed-off-by: Aaron Bohy (aab) --- .../src/views/kanban/kanban_controller.xml | 2 +- .../static/src/views/list/list_controller.xml | 2 +- .../tests/views/kanban/kanban_view_tests.js | 6 ++++++ .../web/static/tests/views/list_view_tests.js | 20 ++++++++++--------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/addons/web/static/src/views/kanban/kanban_controller.xml b/addons/web/static/src/views/kanban/kanban_controller.xml index 3e1e99b23cb..c902ba77c9c 100644 --- a/addons/web/static/src/views/kanban/kanban_controller.xml +++ b/addons/web/static/src/views/kanban/kanban_controller.xml @@ -15,7 +15,7 @@ - + - + {
@@ -13823,6 +13825,9 @@ QUnit.module("Views", (hooks) => {
`, domain, + context: { + a: true, + }, }); patchWithCleanup(kanban.env.services.action, { doActionButton: async (params) => { @@ -13840,6 +13845,7 @@ QUnit.module("Views", (hooks) => { }); assert.deepEqual(context, { + a: true, lang: "en", tz: "taht", uid: 7, diff --git a/addons/web/static/tests/views/list_view_tests.js b/addons/web/static/tests/views/list_view_tests.js index 3d075e66840..a60cfd313d8 100644 --- a/addons/web/static/tests/views/list_view_tests.js +++ b/addons/web/static/tests/views/list_view_tests.js @@ -603,15 +603,12 @@ QUnit.module("Views", (hooks) => { triggerHotkey("control+k"); await nextTick(); - assert.deepEqual( - getNodesTextContent(target.querySelectorAll(".o_command_hotkey")), - [ - "NewALT + C", - "ActionsALT + U", - "Search...ALT + Q", - "Toggle search panelALT + SHIFT + Q" - ] - ); + assert.deepEqual(getNodesTextContent(target.querySelectorAll(".o_command_hotkey")), [ + "NewALT + C", + "ActionsALT + U", + "Search...ALT + Q", + "Toggle search panelALT + SHIFT + Q", + ]); }); QUnit.test('list with delete="0"', async function (assert) { @@ -1029,10 +1026,15 @@ QUnit.module("Views", (hooks) => {
`, + context: { + a: true, + }, }); let cpButtons = getVisibleButtons(target); assert.deepEqual(