feat(fusion_accounting_ai): add ReportsAdapter with trial_balance
Made-with: Cursor
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user