[FIX] clean database menus was proposing good menus to purge (#562)

pull/2804/head
Jordi Ballester Alomar 2016-09-28 19:52:55 +02:00 committed by augusto-weiss
parent 9a3d22aa9f
commit 3b764a1fa7
1 changed files with 4 additions and 2 deletions

View File

@ -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,