diff --git a/fusion_accounting_core/__manifest__.py b/fusion_accounting_core/__manifest__.py
index 1d1f9de0..95479c45 100644
--- a/fusion_accounting_core/__manifest__.py
+++ b/fusion_accounting_core/__manifest__.py
@@ -24,6 +24,7 @@ Built by Nexa Systems Inc.
'maintainer': 'Nexa Systems Inc.',
'depends': ['account', 'mail'],
'data': [
+ 'security/fusion_accounting_security.xml',
'security/ir.model.access.csv',
],
'installable': True,
diff --git a/fusion_accounting_core/migrations/19.0.1.0.0/post-migration.py b/fusion_accounting_core/migrations/19.0.1.0.0/post-migration.py
new file mode 100644
index 00000000..5564954a
--- /dev/null
+++ b/fusion_accounting_core/migrations/19.0.1.0.0/post-migration.py
@@ -0,0 +1,48 @@
+"""Reassign security group/category/privilege xml-ids from the old module name.
+
+Pre-Phase-0, the three fusion security groups (user, manager, admin), the
+module category and the privilege all lived in module='fusion_accounting'.
+Post-Phase-0 (Task 16) they moved into module='fusion_accounting_core'.
+
+Odoo loads the XML from the new location on upgrade, but the existing
+ir_model_data rows still reference the old module. This script rewrites them.
+
+Both fusion_accounting_core and fusion_accounting_ai ship an equivalent
+UPDATE — whichever post-migration runs first wins the rehoming, the other
+is a no-op. This redundancy protects the common case where the two modules
+are upgraded in either order (as well as the case where only one is
+installed in a given database).
+
+Idempotent: running it a second time matches zero rows.
+"""
+
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+CORE_SECURITY_NAMES = (
+ 'module_category_fusion_accounting',
+ 'res_groups_privilege_fusion_accounting',
+ 'group_fusion_accounting_user',
+ 'group_fusion_accounting_manager',
+ 'group_fusion_accounting_admin',
+)
+
+
+def migrate(cr, version):
+ cr.execute(
+ """
+ UPDATE ir_model_data
+ SET module = 'fusion_accounting_core'
+ WHERE module = 'fusion_accounting'
+ AND name = ANY(%s)
+ """,
+ (list(CORE_SECURITY_NAMES),),
+ )
+ moved = cr.rowcount
+ _logger.info(
+ "fusion_accounting_core post-migration: reassigned %d security rows "
+ "from module='fusion_accounting' to module='fusion_accounting_core'",
+ moved,
+ )
diff --git a/fusion_accounting_core/security/fusion_accounting_security.xml b/fusion_accounting_core/security/fusion_accounting_security.xml
new file mode 100644
index 00000000..59953d9c
--- /dev/null
+++ b/fusion_accounting_core/security/fusion_accounting_security.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ Fusion Accounting
+ 25
+
+
+
+
+ Fusion Accounting
+
+
+
+
+
+ User
+ 10
+
+
+
+
+
+
+ Manager
+ 20
+
+
+
+
+
+
+ Administrator
+ 30
+
+
+
+
+
+
+
+
+
+
+
+