From 4677fae89108a9a488e6888b7633838538e20747 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 19 Apr 2026 16:03:00 -0400 Subject: [PATCH] feat(fusion_accounting_reports): period_filter component (date range + comparison) Made-with: Cursor --- fusion_accounting_reports/__manifest__.py | 4 +- .../components/period_filter/period_filter.js | 37 +++++++++++++++++ .../period_filter/period_filter.xml | 40 +++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 fusion_accounting_reports/static/src/components/period_filter/period_filter.js create mode 100644 fusion_accounting_reports/static/src/components/period_filter/period_filter.xml diff --git a/fusion_accounting_reports/__manifest__.py b/fusion_accounting_reports/__manifest__.py index c9fd0ad6..1614bdcc 100644 --- a/fusion_accounting_reports/__manifest__.py +++ b/fusion_accounting_reports/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting Reports', - 'version': '19.0.1.0.26', + 'version': '19.0.1.0.27', 'category': 'Accounting/Accounting', 'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).', 'description': """ @@ -50,6 +50,8 @@ menu hides; the engine and AI tools remain available for the chat. 'fusion_accounting_reports/static/src/components/report_table/report_table.xml', 'fusion_accounting_reports/static/src/components/drill_down_dialog/drill_down_dialog.js', 'fusion_accounting_reports/static/src/components/drill_down_dialog/drill_down_dialog.xml', + 'fusion_accounting_reports/static/src/components/period_filter/period_filter.js', + 'fusion_accounting_reports/static/src/components/period_filter/period_filter.xml', ], }, 'installable': True, diff --git a/fusion_accounting_reports/static/src/components/period_filter/period_filter.js b/fusion_accounting_reports/static/src/components/period_filter/period_filter.js new file mode 100644 index 00000000..2d0af5a0 --- /dev/null +++ b/fusion_accounting_reports/static/src/components/period_filter/period_filter.js @@ -0,0 +1,37 @@ +/** @odoo-module **/ + +import { Component, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + +export class PeriodFilter extends Component { + static template = "fusion_accounting_reports.PeriodFilter"; + static props = {}; + + setup() { + this.reports = useService("fusion_reports"); + this.state = useState(this.reports.state); + } + + async onReportTypeChange(ev) { + const reportType = ev.target.value; + if (reportType && this.state.dateFrom && this.state.dateTo) { + await this.reports.runReport( + reportType, this.state.dateFrom, this.state.dateTo, + this.state.comparison); + } + } + + async onDateChange(field, ev) { + this.state[field] = ev.target.value; + if (this.state.currentReportType && this.state.dateFrom && this.state.dateTo) { + await this.reports.runReport( + this.state.currentReportType, + this.state.dateFrom, this.state.dateTo, + this.state.comparison); + } + } + + async onComparisonChange(ev) { + await this.reports.setComparison(ev.target.value); + } +} diff --git a/fusion_accounting_reports/static/src/components/period_filter/period_filter.xml b/fusion_accounting_reports/static/src/components/period_filter/period_filter.xml new file mode 100644 index 00000000..2c3fdb44 --- /dev/null +++ b/fusion_accounting_reports/static/src/components/period_filter/period_filter.xml @@ -0,0 +1,40 @@ + + + + +
+ + + + + + + + + + + + Loading... +
+
+ +