feat(fusion_accounting_ai): add ReportsAdapter with trial_balance

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-18 23:14:41 -04:00
parent d331dc5fa6
commit 086b24ab36
3 changed files with 74 additions and 2 deletions

View File

@@ -58,3 +58,19 @@ class TestBankRecAdapter(TransactionCase):
ids = [r['id'] for r in rows]
self.assertIn(self.line.id, ids,
f"Expected line {self.line.id} in unreconciled list, got: {ids}")
@tagged('post_install', '-at_install')
class TestReportsAdapter(TransactionCase):
"""Verify the reports adapter computes a trial-balance-shaped result."""
def test_trial_balance_returns_rows_in_pure_community(self):
adapter = get_adapter(self.env, 'reports')
# Compute an empty-filter trial balance for the current company. Should
# return a list (possibly empty in a fresh test DB) without errors.
result = adapter.trial_balance()
self.assertIsInstance(result, list)
# Each row should have account_id and balance keys
for row in result:
self.assertIn('account_id', row)
self.assertIn('balance', row)