feat(fusion_accounting_l10n_ca): Canadian reports + tax return tracking
Replaces Enterprise's l10n_ca_reports with Fusion-native equivalents: - ca_balance_sheet, ca_profit_loss as fusion.report definitions - fusion.tax.return model for GST/HST/PST/T4/T5018 filing tracking - Auto-installs when l10n_ca + fusion_accounting_reports both present Removes Westin's last Canadian-compliance dependency on Enterprise's account_reports. Made-with: Cursor
This commit is contained in:
1
fusion_accounting_l10n_ca/tests/__init__.py
Normal file
1
fusion_accounting_l10n_ca/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_l10n_ca
|
||||
36
fusion_accounting_l10n_ca/tests/test_l10n_ca.py
Normal file
36
fusion_accounting_l10n_ca/tests/test_l10n_ca.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from datetime import date
|
||||
|
||||
from odoo.tests import tagged
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
@tagged("post_install", "-at_install")
|
||||
class TestL10nCa(TransactionCase):
|
||||
|
||||
def test_canadian_reports_seeded(self):
|
||||
Report = self.env["fusion.report"].sudo()
|
||||
ca_bs = Report.search([("code", "=", "ca_balance_sheet")], limit=1)
|
||||
ca_pl = Report.search([("code", "=", "ca_profit_loss")], limit=1)
|
||||
self.assertTrue(ca_bs, "ca_balance_sheet not seeded")
|
||||
self.assertTrue(ca_pl, "ca_profit_loss not seeded")
|
||||
self.assertEqual(ca_bs.report_type, "balance_sheet")
|
||||
self.assertEqual(ca_pl.report_type, "pnl")
|
||||
|
||||
def test_canadian_pnl_runs_via_engine(self):
|
||||
from odoo.addons.fusion_accounting_reports.services.date_periods import Period
|
||||
|
||||
period = Period(date(2025, 1, 1), date(2025, 12, 31), "FY 2025")
|
||||
result = self.env["fusion.report.engine"].compute_pnl(
|
||||
period, report_code="ca_profit_loss",
|
||||
)
|
||||
self.assertEqual(result["report_name"], "Profit and Loss (Canada)")
|
||||
self.assertGreater(len(result["rows"]), 0)
|
||||
|
||||
def test_tax_return_create(self):
|
||||
ret = self.env["fusion.tax.return"].create({
|
||||
"return_type": "gst_hst",
|
||||
"date_from": date(2025, 1, 1),
|
||||
"date_to": date(2025, 3, 31),
|
||||
})
|
||||
self.assertNotEqual(ret.name, "New")
|
||||
self.assertEqual(ret.state, "draft")
|
||||
Reference in New Issue
Block a user