Files
Odoo-Modules/fusion_accounting_migration/wizards/migration_wizard_views.xml
gsinghpal de71a61a8b fix(fusion_accounting_migration): add menu + tighten safety-guard test coverage
Addresses code review feedback on Task 17:
- Add menuitem so 'Fusion Accounting -> Migrate from Enterprise' is reachable
  (the UserError guidance now actually works). Placed at top level since
  parenting under fusion_accounting_ai.menu_fusion_accounting_root would
  require adding that module as a hard dep, which is wrong semantically
  (migration should not require AI). Both menuitems carry the admin group
  so the menu stays hidden from users who can't open the wizard anyway.
- Update the UserError wording to "Fusion Accounting -> Migrate from
  Enterprise" (no longer "Settings -> ...") to match the actual menu
  location; 'migration' is preserved per the test's assertIn check.
- Add skipTest guard to test_uninstall_not_blocked_when_migration_completed
  so it doesn't pass vacuously on Community-only CI (the guard's
  `if not installed: continue` would otherwise return True regardless of
  the flag value, giving a false green).
- Move GUARDED_MODULES import to top of wizards/migration_wizard.py
  (no circular-import risk -- models/ir_module_module.py doesn't import
  from wizards/).
- Expand docstrings on button_immediate_uninstall and module_uninstall
  overrides to note they may both fire in a single UI uninstall call
  and that the guard is idempotent (pure read + raise).

Made-with: Cursor
2026-04-19 00:51:32 -04:00

47 lines
2.0 KiB
XML

<?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>
<!--
Top-level "Fusion Accounting" menu so the UserError guidance
("Fusion Accounting -> Migrate from Enterprise") is actually reachable.
Placed at top level (no parent) because the migration is a one-time
admin task; making it visible during switchover is the point.
`groups` hides the menu from non-admins (mirroring the ACL on the wizard).
-->
<menuitem id="menu_fusion_migration_root"
name="Fusion Accounting"
sequence="95"
groups="fusion_accounting_core.group_fusion_accounting_admin"/>
<menuitem id="menu_fusion_migration_wizard"
name="Migrate from Enterprise"
parent="menu_fusion_migration_root"
action="action_fusion_migration_wizard"
sequence="10"
groups="fusion_accounting_core.group_fusion_accounting_admin"/>
</odoo>