changes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Fusion Accounting - Bank Reconciliation Finish Buttons (Upload Extension)
|
||||
// Copyright (C) 2026 Nexa Systems Inc.
|
||||
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { AccountFileUploader } from "@account/components/account_file_uploader/account_file_uploader";
|
||||
import { BankRecFinishButtons } from "@fusion_accounting/components/bank_reconciliation/finish_buttons";
|
||||
|
||||
/**
|
||||
* Patches BankRecFinishButtons to add the file upload component
|
||||
* for importing bank statements directly from the finish screen.
|
||||
*/
|
||||
patch(BankRecFinishButtons, {
|
||||
components: {
|
||||
AccountFileUploader,
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="fusion_accounting.BankRecFinishButtons" t-inherit="fusion_accounting.BankRecFinishButtons" t-inherit-mode="extension">
|
||||
<xpath expr="//p" position="before">
|
||||
<div class="mb-1" t-call="account.AccountViewUploadButton"/>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -0,0 +1,48 @@
|
||||
// Fusion Accounting - Bank Reconciliation Kanban Upload
|
||||
// Copyright (C) 2026 Nexa Systems Inc.
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { AccountFileUploader } from "@account/components/account_file_uploader/account_file_uploader";
|
||||
import { UploadDropZone } from "@account/components/upload_drop_zone/upload_drop_zone";
|
||||
import { BankRecKanbanView, BankRecKanbanController, BankRecKanbanRenderer } from "@fusion_accounting/components/bank_reconciliation/kanban";
|
||||
import { useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* BankRecKanbanUploadController - Extends the kanban controller with
|
||||
* file upload support for importing bank statements via drag-and-drop.
|
||||
*/
|
||||
export class BankRecKanbanUploadController extends BankRecKanbanController {
|
||||
static components = {
|
||||
...BankRecKanbanController.components,
|
||||
AccountFileUploader,
|
||||
}
|
||||
}
|
||||
|
||||
export class BankRecUploadKanbanRenderer extends BankRecKanbanRenderer {
|
||||
static template = "account.BankRecKanbanUploadRenderer";
|
||||
static components = {
|
||||
...BankRecKanbanRenderer.components,
|
||||
UploadDropZone,
|
||||
};
|
||||
setup() {
|
||||
super.setup();
|
||||
this.dropzoneState = useState({
|
||||
visible: false,
|
||||
});
|
||||
}
|
||||
|
||||
onDragStart(ev) {
|
||||
if (ev.dataTransfer.types.includes("Files")) {
|
||||
this.dropzoneState.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const BankRecKanbanUploadView = {
|
||||
...BankRecKanbanView,
|
||||
Controller: BankRecKanbanUploadController,
|
||||
Renderer: BankRecUploadKanbanRenderer,
|
||||
buttonTemplate: "account.BankRecKanbanButtons",
|
||||
};
|
||||
|
||||
registry.category("views").add('bank_rec_widget_kanban', BankRecKanbanUploadView, { force: true });
|
||||
@@ -0,0 +1,19 @@
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="account.BankRecKanbanButtons">
|
||||
<xpath expr="//div[hasclass('o_cp_buttons')]" position="inside">
|
||||
<t t-call="account.AccountViewUploadButton"/>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-name="account.BankRecKanbanUploadRenderer" t-inherit="account.BankRecKanbanRenderer" t-inherit-mode="primary">
|
||||
<xpath expr="//div[@t-ref='root']" position="before">
|
||||
<UploadDropZone
|
||||
visible="dropzoneState.visible"
|
||||
hideZone="() => dropzoneState.visible = false"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@t-ref='root']" position="attributes">
|
||||
<attribute name="t-on-dragenter.stop.prevent">onDragStart</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -0,0 +1,48 @@
|
||||
// Fusion Accounting - Bank Reconciliation List Upload
|
||||
// Copyright (C) 2026 Nexa Systems Inc.
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { AccountFileUploader } from "@account/components/account_file_uploader/account_file_uploader";
|
||||
import { UploadDropZone } from "@account/components/upload_drop_zone/upload_drop_zone";
|
||||
import { bankRecListView, BankRecListController } from "@fusion_accounting/components/bank_reconciliation/list";
|
||||
import { useState } from "@odoo/owl";
|
||||
|
||||
/**
|
||||
* BankRecListUploadController - Extends the list controller with file
|
||||
* upload capabilities for importing bank statements via drag-and-drop.
|
||||
*/
|
||||
export class BankRecListUploadController extends BankRecListController {
|
||||
static components = {
|
||||
...BankRecListController.components,
|
||||
AccountFileUploader,
|
||||
}
|
||||
}
|
||||
|
||||
export class BankRecListUploadRenderer extends ListRenderer {
|
||||
static template = "account.BankRecListUploadRenderer";
|
||||
static components = {
|
||||
...ListRenderer.components,
|
||||
UploadDropZone,
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup();
|
||||
this.dropzoneState = useState({ visible: false });
|
||||
}
|
||||
|
||||
onDragStart(ev) {
|
||||
if (ev.dataTransfer.types.includes("Files")) {
|
||||
this.dropzoneState.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const bankRecListUploadView = {
|
||||
...bankRecListView,
|
||||
Controller: BankRecListUploadController,
|
||||
Renderer: BankRecListUploadRenderer,
|
||||
buttonTemplate: "account.BankRecListUploadButtons",
|
||||
}
|
||||
|
||||
registry.category("views").add("bank_rec_list", bankRecListUploadView, { force: true });
|
||||
@@ -0,0 +1,19 @@
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="account.BankRecListUploadButtons" t-inherit="web.ListView.Buttons" t-inherit-mode="primary">
|
||||
<xpath expr="//div[hasclass('o_list_buttons')]" position="inside">
|
||||
<t t-call="account.AccountViewUploadButton"/>
|
||||
</xpath>
|
||||
</t>
|
||||
|
||||
<t t-name="account.BankRecListUploadRenderer" t-inherit="web.ListRenderer" t-inherit-mode="primary">
|
||||
<xpath expr="//div[@t-ref='root']" position="before">
|
||||
<UploadDropZone
|
||||
visible="dropzoneState.visible"
|
||||
hideZone="() => dropzoneState.visible = false"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@t-ref='root']" position="attributes">
|
||||
<attribute name="t-on-dragenter.stop.prevent">onDragStart</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user