From 596ecb9e03c00084e773c7e14718a8eea2964301 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 19 Apr 2026 13:03:50 -0400 Subject: [PATCH] feat(fusion_accounting_bank_rec): fusion-only batch action bar + reconcile model picker batch_action_bar exposes bulk Suggest-for-selected and Auto-reconcile-selected toolbar driven by selectedIds prop and the bank_reconciliation service. reconcile_model_picker is a quick-pick dropdown over account.reconcile.model records (rule_type=writeoff_button) including the Fusion AI confidence threshold; apply path is a state-only stub pending Task 38's dedicated endpoint. Made-with: Cursor --- fusion_accounting_bank_rec/__manifest__.py | 7 +++- .../batch_action_bar/batch_action_bar.js | 37 ++++++++++++++++++ .../batch_action_bar/batch_action_bar.xml | 17 ++++++++ .../reconcile_model_picker.js | 39 +++++++++++++++++++ .../reconcile_model_picker.xml | 14 +++++++ 5 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.js create mode 100644 fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.xml create mode 100644 fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.js create mode 100644 fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.xml diff --git a/fusion_accounting_bank_rec/__manifest__.py b/fusion_accounting_bank_rec/__manifest__.py index 81e3962e..8e828b1e 100644 --- a/fusion_accounting_bank_rec/__manifest__.py +++ b/fusion_accounting_bank_rec/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting — Bank Reconciliation', - 'version': '19.0.1.0.16', + 'version': '19.0.1.0.17', 'category': 'Accounting/Accounting', 'sequence': 28, 'summary': 'Native V19 bank reconciliation widget with AI confidence scoring + behavioural learning.', @@ -87,6 +87,11 @@ Built by Nexa Systems Inc. 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/ai_suggestion/ai_alternatives_panel.xml', 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/ai_suggestion/ai_reasoning_tooltip.js', 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/ai_suggestion/ai_reasoning_tooltip.xml', + # Fusion-only (Task 35) — batch action bar + reconcile model picker + 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.js', + 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.xml', + 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.js', + 'fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.xml', ], }, 'installable': True, diff --git a/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.js b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.js new file mode 100644 index 00000000..d12e25c7 --- /dev/null +++ b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.js @@ -0,0 +1,37 @@ +/** @odoo-module **/ + +import { Component } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + +export class BatchActionBar extends Component { + static template = "fusion_accounting_bank_rec.BatchActionBar"; + static props = { + selectedIds: { type: Array, optional: true }, + }; + + setup() { + this.bankRec = useService("fusion_bank_reconciliation"); + } + + get hasSelection() { + return this.props.selectedIds && this.props.selectedIds.length > 0; + } + + get selectionCount() { + return this.props.selectedIds ? this.props.selectedIds.length : 0; + } + + async onAutoReconcile() { + if (!this.hasSelection) { + return; + } + await this.bankRec.bulkReconcile(this.props.selectedIds, "auto"); + } + + async onSuggestForSelected() { + if (!this.hasSelection) { + return; + } + await this.bankRec.suggestMatches(this.props.selectedIds, 3); + } +} diff --git a/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.xml b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.xml new file mode 100644 index 00000000..a3b7479f --- /dev/null +++ b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/batch_action_bar/batch_action_bar.xml @@ -0,0 +1,17 @@ + + + +
+ + selected + + + +
+
+
diff --git a/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.js b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.js new file mode 100644 index 00000000..46666944 --- /dev/null +++ b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.js @@ -0,0 +1,39 @@ +/** @odoo-module **/ + +import { Component, onWillStart, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + +export class ReconcileModelPicker extends Component { + static template = "fusion_accounting_bank_rec.ReconcileModelPicker"; + static props = { + statementLineId: { type: Number, optional: true }, + }; + + setup() { + this.orm = useService("orm"); + this.bankRec = useService("fusion_bank_reconciliation"); + this.state = useState({ models: [], selected: null }); + + onWillStart(async () => { + const models = await this.orm.searchRead( + "account.reconcile.model", + [["rule_type", "=", "writeoff_button"]], + ["id", "name", "fusion_ai_confidence_threshold"], + { limit: 20 } + ); + this.state.models = models; + }); + } + + onChange(ev) { + const value = parseInt(ev.target.value, 10); + if (Number.isFinite(value)) { + this.onApplyModel(value); + } + } + + async onApplyModel(modelId) { + // Phase 1 placeholder: TODO route through dedicated endpoint when Task 38 lands + this.state.selected = modelId; + } +} diff --git a/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.xml b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.xml new file mode 100644 index 00000000..1df539e2 --- /dev/null +++ b/fusion_accounting_bank_rec/static/src/components/bank_reconciliation/reconcile_model_picker/reconcile_model_picker.xml @@ -0,0 +1,14 @@ + + + +
+ +
+
+