From 7da1be97764e481f88181cfdd1fa6c9a1e497cd0 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Wed, 28 Sep 2016 19:52:55 +0200 Subject: [PATCH] [FIX] clean database menus was proposing good menus to purge (#562) --- database_cleanup/models/purge_menus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/database_cleanup/models/purge_menus.py b/database_cleanup/models/purge_menus.py index bef098b28..027164933 100644 --- a/database_cleanup/models/purge_menus.py +++ b/database_cleanup/models/purge_menus.py @@ -34,8 +34,10 @@ class CleanupPurgeWizardMenu(models.TransientModel): .search([('action', '!=', False)]): if menu.action.type != 'ir.actions.act_window': continue - if menu.action.res_model not in self.env or\ - menu.action.src_model not in self.env: + if (menu.action.res_model and menu.action.res_model not in + self.env) or \ + (menu.action.src_model and menu.action.src_model not in + self.env): res.append((0, 0, { 'name': menu.complete_name, 'menu_id': menu.id,