Created
October 5, 2020 20:30
-
-
Save odony/42b1a58f885b94f3293bf1be007ac004 to your computer and use it in GitHub Desktop.
fix_v14_db_uninstall_account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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