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

pull/2684/head
Jordi Ballester Alomar 2016-09-28 19:52:55 +02:00 committed by Miika Nissi
parent e3b8fda908
commit 3778616fd5
No known key found for this signature in database
GPG Key ID: B20DC9FCFAF92E7F
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,