feat(fusion_accounting_core): shared-field-ownership for deferred fields, signing_user, created_automatically

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-18 23:55:32 -04:00
parent e79f11f5f0
commit 10140a6968
5 changed files with 108 additions and 0 deletions

View File

@@ -1 +1,2 @@
from . import test_enterprise_detection
from . import test_shared_field_ownership

View File

@@ -0,0 +1,32 @@
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install')
class TestSharedFieldOwnership(TransactionCase):
"""Verify fusion_accounting_core declares the Enterprise extension fields
on account.move and account.reconcile.model, so they survive Enterprise uninstall."""
def test_account_move_deferred_fields_exist(self):
Move = self.env['account.move']
for fname in ('deferred_move_ids', 'deferred_original_move_ids', 'deferred_entry_type'):
self.assertIn(fname, Move._fields, f"{fname!r} must exist on account.move")
def test_account_move_signing_user_exists(self):
Move = self.env['account.move']
self.assertIn('signing_user', Move._fields)
def test_account_move_payment_state_before_switch_exists(self):
Move = self.env['account.move']
self.assertIn('payment_state_before_switch', Move._fields)
def test_account_reconcile_model_created_automatically_exists(self):
Model = self.env['account.reconcile.model']
self.assertIn('created_automatically', Model._fields)
def test_deferred_relation_table_name_matches_enterprise(self):
"""The shared M2M relation table must be named identically to Enterprise's
so dual ownership works (Enterprise drops field => fusion preserves table)."""
f = self.env['account.move']._fields['deferred_move_ids']
self.assertEqual(f.relation, 'account_move_deferred_rel')
self.assertEqual(f.column1, 'original_move_id')
self.assertEqual(f.column2, 'deferred_move_id')