diff --git a/fusion_accounting_core/__manifest__.py b/fusion_accounting_core/__manifest__.py index 95479c45..ad3aa1f3 100644 --- a/fusion_accounting_core/__manifest__.py +++ b/fusion_accounting_core/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting Core', - 'version': '19.0.1.0.0', + 'version': '19.0.1.0.1', 'category': 'Accounting/Accounting', 'sequence': 24, 'summary': 'Shared base for the Fusion Accounting sub-module suite (security, shared schema, runtime helpers).', diff --git a/fusion_accounting_core/models/__init__.py b/fusion_accounting_core/models/__init__.py index bcc7bba4..503920da 100644 --- a/fusion_accounting_core/models/__init__.py +++ b/fusion_accounting_core/models/__init__.py @@ -1,3 +1,4 @@ from . import ir_module_module from . import account_move from . import account_reconcile_model +from . import account_bank_statement_line diff --git a/fusion_accounting_core/models/account_bank_statement_line.py b/fusion_accounting_core/models/account_bank_statement_line.py new file mode 100644 index 00000000..b08183ef --- /dev/null +++ b/fusion_accounting_core/models/account_bank_statement_line.py @@ -0,0 +1,15 @@ +"""Shared-field-ownership for account.bank.statement.line. + +Enterprise's account_accountant adds cron_last_check (timestamp of the last +auto-reconcile cron run for the line). By declaring it here with the same +schema, fusion_accounting_core becomes a co-owner so the column persists +when account_accountant uninstalls. +""" + +from odoo import fields, models + + +class AccountBankStatementLine(models.Model): + _inherit = "account.bank.statement.line" + + cron_last_check = fields.Datetime(copy=False) diff --git a/fusion_accounting_core/tests/__init__.py b/fusion_accounting_core/tests/__init__.py index 10b90050..832786bc 100644 --- a/fusion_accounting_core/tests/__init__.py +++ b/fusion_accounting_core/tests/__init__.py @@ -1,2 +1,3 @@ from . import test_enterprise_detection from . import test_shared_field_ownership +from . import test_shared_field_bank_statement diff --git a/fusion_accounting_core/tests/test_shared_field_bank_statement.py b/fusion_accounting_core/tests/test_shared_field_bank_statement.py new file mode 100644 index 00000000..65b5686e --- /dev/null +++ b/fusion_accounting_core/tests/test_shared_field_bank_statement.py @@ -0,0 +1,14 @@ +from odoo.tests.common import TransactionCase, tagged + + +@tagged('post_install', '-at_install') +class TestSharedFieldBankStatementLine(TransactionCase): + """Verify fusion_accounting_core declares the Enterprise extension fields + on account.bank.statement.line so they survive Enterprise uninstall.""" + + def test_cron_last_check_field_exists(self): + Line = self.env['account.bank.statement.line'] + self.assertIn('cron_last_check', Line._fields, + "cron_last_check must be declared on account.bank.statement.line " + "(shared-field-ownership with account_accountant)") + self.assertEqual(Line._fields['cron_last_check'].type, 'datetime')