feat(fusion_accounting_core): add _fusion_is_enterprise_accounting_installed helper

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-18 23:46:44 -04:00
parent 182978606d
commit b637723c6a
4 changed files with 54 additions and 2 deletions

View File

@@ -1 +1 @@
# Tests populated in Tasks 8-12
from . import test_enterprise_detection

View File

@@ -0,0 +1,20 @@
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install')
class TestEnterpriseDetection(TransactionCase):
"""Verify the helper that detects Odoo Enterprise accounting installs."""
def test_helper_returns_bool(self):
result = self.env['ir.module.module']._fusion_is_enterprise_accounting_installed()
self.assertIsInstance(result, bool)
def test_helper_matches_actual_state(self):
"""Helper should return True iff one of the known Enterprise modules is installed."""
installed = self.env['ir.module.module'].sudo().search_count([
('name', 'in', ['account_accountant', 'account_reports', 'accountant']),
('state', '=', 'installed'),
])
expected = bool(installed)
actual = self.env['ir.module.module']._fusion_is_enterprise_accounting_installed()
self.assertEqual(actual, expected)