diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index ac1d7b980e8..6e5461e8a20 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -300,7 +300,24 @@ class ir_ui_menu(osv.osv): the action domain """ res = {} + menu_ids = set() for menu in self.browse(cr, uid, ids, context=context): + menu_ids.add(menu.id) + ctx = None + if menu.action and menu.action.type in ('ir.actions.act_window', 'ir.actions.client') and menu.action.context: + ctx = eval(menu.action.context, context) or None + menu_ref = ctx and ctx.get('needaction_menu_ref') + if menu_ref: + if not isinstance(menu_ref, list): + menu_ref = [menu_ref] + model_data_obj = self.pool.get('ir.model.data') + for menu_data in menu_ref: + model, id = model_data_obj.get_object_reference(cr, uid, menu_data.split('.')[0], menu_data.split('.')[1]) + if (model == 'ir.ui.menu'): + menu_ids.add(id) + menu_ids = list(menu_ids) + + for menu in self.browse(cr, uid, menu_ids, context=context): res[menu.id] = { 'needaction_enabled': False, 'needaction_counter': False, diff --git a/openerp/report/render/rml2pdf/utils.py b/openerp/report/render/rml2pdf/utils.py index 75923e64081..adca350c8d0 100644 --- a/openerp/report/render/rml2pdf/utils.py +++ b/openerp/report/render/rml2pdf/utils.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -# trml2pdf - An RML to PDF converter # Copyright (C) 2003, Fabien Pinckaers, UCL, FSA +# Copyright (C) 2004-2009 Tiny SPRL (). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -35,6 +17,8 @@ # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +############################################################################## import copy import locale