This commit is contained in:
gsinghpal
2026-05-16 13:18:52 -04:00
parent 191a9c82be
commit 9ebf89bde2
1080 changed files with 0 additions and 1197 deletions

View File

@@ -0,0 +1 @@
from . import migration_wizard

View File

@@ -0,0 +1,66 @@
"""Migration wizard skeleton.
Per-feature migration logic (account.asset -> fusion.asset, etc.) is added
by each fusion sub-module that replaces an Enterprise feature, by extending
this wizard via _inherit.
Phase 0 ships the wizard with no migrations registered. Phase 1 will add
the bank-rec verification check. Phase 6 will add asset migration, etc.
"""
from odoo import _, api, fields, models
from ..models.ir_module_module import GUARDED_MODULES
class FusionMigrationWizard(models.TransientModel):
_name = "fusion.migration.wizard"
_description = "Migrate from Odoo Enterprise to Fusion Accounting"
enterprise_modules_detected = fields.Char(
compute='_compute_detected',
string="Enterprise Modules Detected",
)
notes = fields.Text(default=lambda self: self._default_notes())
def _default_notes(self):
return _(
"This wizard migrates data from Odoo Enterprise accounting modules "
"to Fusion Accounting tables. Run before uninstalling Enterprise. "
"After a successful run, each migrated module is marked complete "
"and the Enterprise uninstall safety guard will allow uninstall.\n\n"
"Phase 0 of the roadmap ships this wizard as a shell. As Phase 1, "
"Phase 5, Phase 6, etc. ship, each adds its own migration step here."
)
@api.depends_context('uid')
def _compute_detected(self):
Mod = self.env['ir.module.module'].sudo()
installed = Mod.search([
('name', 'in', list(GUARDED_MODULES)),
('state', '=', 'installed'),
])
for w in self:
w.enterprise_modules_detected = ', '.join(installed.mapped('name')) or _("None")
def action_run_migration(self):
"""Stub: Phase 0 has no migrations to run.
Sub-modules extend this method to perform their per-module migration,
then set the corresponding fusion_accounting.migration.<name>.completed
config param to True.
"""
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'info',
'title': _("Nothing to migrate (yet)"),
'message': _(
"Phase 0 ships the migration framework but no per-feature "
"migrations are registered yet. Each fusion sub-module that "
"replaces an Enterprise feature (Phase 1+) will register its "
"own migration step here."
),
},
}

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_fusion_migration_wizard_form" model="ir.ui.view">
<field name="name">fusion.migration.wizard.form</field>
<field name="model">fusion.migration.wizard</field>
<field name="arch" type="xml">
<form string="Migrate from Enterprise">
<sheet>
<group>
<field name="enterprise_modules_detected" readonly="1"/>
<field name="notes" readonly="1"/>
</group>
</sheet>
<footer>
<button name="action_run_migration" type="object" string="Run Migration" class="btn-primary"/>
<button special="cancel" string="Close" class="btn-secondary"/>
</footer>
</form>
</field>
</record>
<record id="action_fusion_migration_wizard" model="ir.actions.act_window">
<field name="name">Migrate from Enterprise</field>
<field name="res_model">fusion.migration.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!--
Migration wizard lives under Accounting > Configuration, and is
ONLY visible while at least one Enterprise accounting module is
still installed. Once the operator has uninstalled Enterprise, the
wizard is hidden \u2014 there's nothing left to migrate.
Visibility is gated by the intersection of:
- group_fusion_accounting_admin (admin-only feature)
- group_fusion_show_when_enterprise_present (computed: members
iff at least one Enterprise accounting module is installed)
-->
<!-- Note: gating uses ONLY group_fusion_show_when_enterprise_present.
Admin-restriction is enforced via the model ACL
(ir.model.access.csv only grants access to group_fusion_accounting_admin).
Odoo `groups=` on menuitems uses OR semantics, so listing both groups
would let any admin see the menu even after Enterprise is uninstalled. -->
<menuitem id="menu_fusion_migration_root"
name="Migrate from Enterprise"
parent="account.menu_finance_configuration"
sequence="95"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_present"/>
<menuitem id="menu_fusion_migration_wizard"
name="Run Migration Wizard"
parent="menu_fusion_migration_root"
action="action_fusion_migration_wizard"
sequence="10"
groups="fusion_accounting_core.group_fusion_show_when_enterprise_present"/>
</odoo>