Skip to content

Instantly share code, notes, and snippets.

@odony
Created October 5, 2020 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odony/42b1a58f885b94f3293bf1be007ac004 to your computer and use it in GitHub Desktop.
Save odony/42b1a58f885b94f3293bf1be007ac004 to your computer and use it in GitHub Desktop.
fix_v14_db_uninstall_account
# Run this in an odoo shell command, assuming you can still start a shell on the broken database
# repair the ir.action* table structure
env.registry.init_models(env.cr, ['ir.actions.actions', 'ir.actions.act_window',
'ir.actions.server', 'ir.actions.act_url',
'ir.actions.client', 'ir.actions.report'], {})
# re-allow name constraint
env.cr.execute("update ir_actions set name = 'action ' || id where name is null");
# repair constraint again
env.registry.init_models(env.cr, ['ir.actions.actions', 'ir.actions.act_window',
'ir.actions.server', 'ir.actions.act_url',
'ir.actions.client', 'ir.actions.report'], {})
# commit then force an update of all modules
env.cr.commit()
env.ref('base.module_base').button_immediate_upgrade()
# final commit after repair
env.cr.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment