Align account_do with core localization structure
Add CreateChart defaults for the Dominican receivable and payable accounts, following the pattern used by official Tryton localization modules. Register the chart wizard extension, add core-style documentation files, and protect the structure with transactional and static tests.
This commit is contained in:
+15
-2
@@ -318,6 +318,11 @@ class AccountDoTestCase(ModuleTestCase):
|
||||
('party_required', '=', True),
|
||||
('closed', '!=', True),
|
||||
], limit=1)
|
||||
defaults = chart.default_properties([
|
||||
'company', 'account_receivable', 'account_payable'])
|
||||
self.assertEqual(defaults['company'], company.id)
|
||||
self.assertEqual(defaults['account_receivable'], receivable.id)
|
||||
self.assertEqual(defaults['account_payable'], payable.id)
|
||||
for code in [
|
||||
'111002', '120192', '120292', '120392', '120591',
|
||||
'120592', '120891', '120892', '120992', '7101', '7102',
|
||||
@@ -496,8 +501,10 @@ class AccountDoUnitTestCase(unittest.TestCase):
|
||||
'tax.TaxCode',
|
||||
'tax.TaxCodeLine',
|
||||
])
|
||||
self.assertEqual(lines('register', 'wizard'), ['account.CreateChart'])
|
||||
for filename in lines('tryton', 'xml'):
|
||||
self.assertTrue((MODULE_DIR / filename).is_file())
|
||||
self.assertTrue((MODULE_DIR / 'account.py').is_file())
|
||||
|
||||
pyproject = (MODULE_DIR / 'pyproject.toml').read_text(encoding='utf-8')
|
||||
self.assertIn("name = 'trytond_account_do'", pyproject)
|
||||
@@ -511,8 +518,14 @@ class AccountDoUnitTestCase(unittest.TestCase):
|
||||
'tests/**/*.rst',
|
||||
]:
|
||||
self.assertIn(package_file, pyproject)
|
||||
self.assertEqual(
|
||||
(MODULE_DIR / '__init__.py').read_text(encoding='utf-8'), '')
|
||||
init = (MODULE_DIR / '__init__.py').read_text(encoding='utf-8')
|
||||
self.assertIn('This file is part of Tryton.', init)
|
||||
account = (MODULE_DIR / 'account.py').read_text(encoding='utf-8')
|
||||
self.assertIn("class CreateChart(metaclass=PoolMeta):", account)
|
||||
self.assertIn(
|
||||
"'account_do.do_account_110201'", account)
|
||||
self.assertIn(
|
||||
"'account_do.do_account_210101'", account)
|
||||
|
||||
def test_xml_record_inventory_is_explicit(self):
|
||||
expected = {
|
||||
|
||||
Reference in New Issue
Block a user