Last active
May 25, 2023 08:21
-
-
Save PierreCourt/ae84f243642e55044712edd31f645ef1 to your computer and use it in GitHub Desktop.
Find ir.model with no app linked
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
| l = [] | |
| for m in env['ir.model'].search([]): | |
| m._in_modules() | |
| if m.modules is '': | |
| l.append(m.id) | |
| #query = ("delete from ir_model_fields where model_id in (%s)" % ','.join(map(str, l))) | |
| #env.cr.execute(query) | |
| #env.cr.commit() | |
| #query = ("delete from ir_model where id in (%s)" % ','.join(map(str, l))) | |
| #env.cr.execute(query) | |
| #env.cr.commit() | |
| raise UserError(l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment