feat(fusion_accounting_ai): wire FollowupAdapter fusion paths to engine

- Switch FUSION_MODEL to fusion.followup.engine so adapter mode
  selection matches the new module
- Add list_overdue() with fusion/enterprise/community variants
- Re-route send_followup_via_fusion to engine.send_followup_email
- 4 new TransactionCase tests (73 total)

Existing aging / overdue_invoices adapter methods continue to fall
back to the community implementation.

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-19 21:02:17 -04:00
parent d455016c27
commit 993df3a14a
4 changed files with 123 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
'name': 'Fusion Accounting Follow-up',
'version': '19.0.1.0.15',
'version': '19.0.1.0.16',
'category': 'Accounting/Accounting',
'summary': 'AI-augmented customer follow-ups (dunning) for unpaid invoices.',
'description': """

View File

@@ -11,3 +11,4 @@ from . import test_account_move_line_inherit
from . import test_fusion_followup_engine
from . import test_engine_integration
from . import test_followup_controller
from . import test_followup_adapter

View File

@@ -0,0 +1,42 @@
"""FollowupAdapter wiring tests — engine paths."""
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
from odoo.addons.fusion_accounting_ai.services.data_adapters.followup import (
FollowupAdapter,
)
@tagged('post_install', '-at_install')
class TestFollowupAdapter(TransactionCase):
def setUp(self):
super().setUp()
self.adapter = FollowupAdapter(self.env)
def test_list_overdue_via_fusion_returns_dict(self):
result = self.adapter.list_overdue_via_fusion(
company_id=self.env.company.id,
)
self.assertIn('partners', result)
self.assertIn('total', result)
self.assertIn('count', result)
def test_list_overdue_via_community_returns_error(self):
result = self.adapter.list_overdue_via_community()
self.assertIn('error', result)
def test_send_followup_via_fusion_no_overdue(self):
partner = self.env['res.partner'].create({'name': 'AdapterTest'})
result = self.adapter.send_followup_via_fusion(
partner_id=partner.id, force=True,
)
self.assertIn(
result.get('status', ''),
('no_action', 'no_overdue', 'sent', 'manual_review'),
)
def test_send_followup_via_community_returns_error(self):
result = self.adapter.send_followup_via_community(partner_id=1)
self.assertIn('error', result)