Files
Odoo-Modules/fusion_accounting_reports/views/menu_views.xml
gsinghpal 8217bb0ff6 fix(fusion_accounting_reports): expose dynamic OWL reports as menu items
User reported that after Enterprise uninstall, clicking 'Reports' opened
PDF statements instead of the dynamic Fusion report viewer. Root cause:
the OWL ReportViewer (registered as view_type='fusion_reports') was only
reachable via the period-picker WIZARD; no menu items used the OWL view
directly. Plus the JS service ignored report_code, so even within the
viewer, all PnL-typed reports rendered the canonical P&L line_specs.

Changes:

JS layer
- reports_service.js: runReport now accepts and forwards reportCode;
  state tracks currentReportCode so re-runs after period/comparison
  changes preserve the variant.
- report_viewer.js: reads default_report_code (and default_comparison)
  from the action context.
- period_filter.js: passes the cached reportCode on date changes;
  clears it when the user picks a different report_type.

Backend
- New fusion_accounting_reports/views/report_actions.xml with 11
  dedicated ir.actions.act_window records, one per built-in report
  (P&L, Balance Sheet, Trial Balance, GL, Cash Flow, Executive Summary,
  Annual Statements, Aged Receivable, Aged Payable, Partner Ledger,
  Tax Summary). Each opens view_mode='fusion_reports' with the
  appropriate default_report_type + default_report_code context.
- views/menu_views.xml: each report now gets its own menu item
  directly under Accounting > Reporting (sequence 10-40), matching
  Enterprise's flat structure. Custom Period wizard, XLSX export and
  Anomaly browser collected under a 'Tools' sub-group at the bottom.
- fusion_accounting_l10n_ca: adds menu items for 'Profit and Loss
  (Canada)' and 'Balance Sheet (Canada)' as siblings, plus a 'Tax
  Returns (CA)' configuration menu.

Verified live on westin-v19:
- pnl rendering 3 rows, cash_flow 9, executive_summary 7,
  annual_statements 5, ca_profit_loss 9 \u2014 each report now renders
  its own line_specs correctly.
- Reporting menu shows 14 Fusion report entries + Tools group.
- 136/136 reports + l10n_ca tests pass.

Version bumps: reports 19.0.1.1.1, l10n_ca 19.0.1.1.0.

Made-with: Cursor
2026-04-20 01:11:48 -04:00

126 lines
5.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Fusion dynamic financial reports live as direct children of the
Community "Reporting" sub-menu (account.menu_finance_reports),
sitting alongside Community's PDF-based "Statement Reports" /
"Partner Reports" / "Taxes & Fiscal" / "Management" wrappers.
Each menu opens an act_window with view_mode='fusion_reports'
(the OWL ReportViewer). report_actions.xml defines the actions.
All gated to the coexistence group so they only appear when
Enterprise's account_reports is uninstalled.
-->
<!-- Top of the list \u2014 daily-driver statements -->
<menuitem id="menu_fusion_reports_pnl"
name="Profit and Loss"
parent="account.menu_finance_reports"
action="action_fusion_report_pnl"
sequence="10"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_bs"
name="Balance Sheet"
parent="account.menu_finance_reports"
action="action_fusion_report_balance_sheet"
sequence="11"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_executive_summary"
name="Executive Summary"
parent="account.menu_finance_reports"
action="action_fusion_report_executive_summary"
sequence="12"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_cash_flow"
name="Cash Flow Statement"
parent="account.menu_finance_reports"
action="action_fusion_report_cash_flow"
sequence="13"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_annual_statements"
name="Annual Statements"
parent="account.menu_finance_reports"
action="action_fusion_report_annual_statements"
sequence="14"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<!-- Audit / drill-down statements -->
<menuitem id="menu_fusion_reports_tb"
name="Trial Balance"
parent="account.menu_finance_reports"
action="action_fusion_report_trial_balance"
sequence="20"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_gl"
name="General Ledger"
parent="account.menu_finance_reports"
action="action_fusion_report_general_ledger"
sequence="21"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<!-- Partner-grouped -->
<menuitem id="menu_fusion_reports_aged_receivable"
name="Aged Receivable"
parent="account.menu_finance_reports"
action="action_fusion_report_aged_receivable"
sequence="30"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_aged_payable"
name="Aged Payable"
parent="account.menu_finance_reports"
action="action_fusion_report_aged_payable"
sequence="31"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_partner_ledger"
name="Partner Ledger"
parent="account.menu_finance_reports"
action="action_fusion_report_partner_ledger"
sequence="32"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<!-- Tax -->
<menuitem id="menu_fusion_reports_tax"
name="Tax Summary"
parent="account.menu_finance_reports"
action="action_fusion_report_tax_summary"
sequence="40"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<!--
Tools group at the bottom: custom-period picker, XLSX export wizard,
anomaly browser. Less-frequently used; bundled together so they
don't clutter the report list.
-->
<menuitem id="menu_fusion_reports_tools_group"
name="Tools"
parent="account.menu_finance_reports"
sequence="90"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_open"
name="Custom Period..."
parent="menu_fusion_reports_tools_group"
action="action_fusion_period_picker_wizard"
sequence="10"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<menuitem id="menu_fusion_reports_xlsx"
name="Export to XLSX..."
parent="menu_fusion_reports_tools_group"
action="action_fusion_xlsx_export_wizard"
sequence="20"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
<record id="action_fusion_report_anomaly_list" model="ir.actions.act_window">
<field name="name">Report Anomalies</field>
<field name="res_model">fusion.report.anomaly</field>
<field name="view_mode">list,form</field>
</record>
<menuitem id="menu_fusion_reports_anomalies"
name="Anomalies"
parent="menu_fusion_reports_tools_group"
action="action_fusion_report_anomaly_list"
sequence="30"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_absent"/>
</odoo>