From 31e381f170b31f92011c375c80848dbc0640117c Mon Sep 17 00:00:00 2001 From: "Habib (ayh)" Date: Sat, 27 Aug 2022 20:52:59 +0000 Subject: [PATCH] [FIX] account: upload buttons on Accounting Dashboard are disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OWL disables view buttons that are missing attributes. These buttons used legacy javascript, and were omitted from the accounting owl migration. Activate those buttons. closes odoo/odoo#99066 Related: odoo/enterprise#30815 Signed-off-by: William André (wan) --- .../components/bills_upload/bills_upload.js | 10 +++++++ .../components/bills_upload/bills_upload.scss | 4 +++ .../components/bills_upload/bills_upload.xml | 26 +++++++--------- .../views/account_journal_dashboard_view.xml | 30 ++++++++++++++----- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/addons/account/static/src/components/bills_upload/bills_upload.js b/addons/account/static/src/components/bills_upload/bills_upload.js index a35e8d4ee53..35d70e8203c 100644 --- a/addons/account/static/src/components/bills_upload/bills_upload.js +++ b/addons/account/static/src/components/bills_upload/bills_upload.js @@ -8,6 +8,7 @@ import { ListController } from "@web/views/list/list_controller"; import { kanbanView } from "@web/views/kanban/kanban_view"; import { KanbanRenderer } from "@web/views/kanban/kanban_renderer"; import { KanbanController } from "@web/views/kanban/kanban_controller"; +import { KanbanDropdownMenuWrapper } from "@web/views/kanban/kanban_dropdown_menu_wrapper"; import { KanbanRecord } from "@web/views/kanban/kanban_record"; import { FileUploader } from "@web/views/fields/file_handler"; @@ -126,6 +127,14 @@ export const AccountMoveUploadKanbanView = { }; // Accounting Dashboard +export class DashboardKanbanDropdownMenuWrapper extends KanbanDropdownMenuWrapper { + onClick(ev) { + // Keep the dropdown open as we need the fileuploader to remain in the dom + if (!ev.target.tagName === "INPUT" && !ev.target.closest('.file_upload_kanban_action_a')) { + super.onClick(ev); + } + } +} export class DashboardKanbanRecord extends KanbanRecord { setup() { super.setup(); @@ -138,6 +147,7 @@ DashboardKanbanRecord.components = { ...DashboardKanbanRecord.components, AccountDropZone, AccountFileUploader, + KanbanDropdownMenuWrapper: DashboardKanbanDropdownMenuWrapper, }; DashboardKanbanRecord.template = "account.DashboardKanbanRecord"; diff --git a/addons/account/static/src/components/bills_upload/bills_upload.scss b/addons/account/static/src/components/bills_upload/bills_upload.scss index 6dabf015602..b705e840c77 100644 --- a/addons/account/static/src/components/bills_upload/bills_upload.scss +++ b/addons/account/static/src/components/bills_upload/bills_upload.scss @@ -13,3 +13,7 @@ height: 100%; } } + +.file_upload_kanban_action_a { + @include o-kanban-dashboard-dropdown-link($link-padding-gap: $o-kanban-dashboard-dropdown-complex-gap); +} diff --git a/addons/account/static/src/components/bills_upload/bills_upload.xml b/addons/account/static/src/components/bills_upload/bills_upload.xml index 072d88154d7..caa66267dcf 100644 --- a/addons/account/static/src/components/bills_upload/bills_upload.xml +++ b/addons/account/static/src/components/bills_upload/bills_upload.xml @@ -20,7 +20,7 @@ onUploaded.bind="onFileUploaded" onUploadComplete.bind="onUploadComplete"> - + @@ -50,28 +50,24 @@ - - - - - + - - - - - + + + + + + +
+ + + + + +
@@ -170,9 +180,13 @@
@@ -272,7 +286,7 @@
- Create Statements + Create Statements
@@ -321,9 +335,11 @@ - + + + Upload + +