Skip to content

Commit 7da1be9

Browse files
JordiBForgeFlowmoylop260
authored andcommitted
[FIX] clean database menus was proposing good menus to purge (OCA#562)
1 parent 92d5c43 commit 7da1be9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

database_cleanup/models/purge_menus.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ def find(self):
3434
.search([('action', '!=', False)]):
3535
if menu.action.type != 'ir.actions.act_window':
3636
continue
37-
if menu.action.res_model not in self.env or\
38-
menu.action.src_model not in self.env:
37+
if (menu.action.res_model and menu.action.res_model not in
38+
self.env) or \
39+
(menu.action.src_model and menu.action.src_model not in
40+
self.env):
3941
res.append((0, 0, {
4042
'name': menu.complete_name,
4143
'menu_id': menu.id,

0 commit comments

Comments
 (0)