diff --git a/addons/base_report_creator/__terp__.py b/addons/base_report_creator/__terp__.py index bee7ec57c91..a706f0c9317 100644 --- a/addons/base_report_creator/__terp__.py +++ b/addons/base_report_creator/__terp__.py @@ -38,6 +38,7 @@ the "Dashboard" menu. 'update_xml': [ 'security/ir.model.access.csv', 'wizard/report_menu_create_view.xml', + 'wizard/report_open_view.xml', 'base_report_creator_wizard.xml', 'base_report_creator_view.xml' ], diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml index ac3052a7769..f9b4b901067 100644 --- a/addons/base_report_creator/base_report_creator_view.xml +++ b/addons/base_report_creator/base_report_creator_view.xml @@ -151,26 +151,11 @@ id="menu_base_report_creator_action" action="base_report_creator_action_tree"/> - - - - - - Browse Report - - - - - - - - Browse Report - - - - + + + diff --git a/addons/base_report_creator/security/ir.model.access.csv b/addons/base_report_creator/security/ir.model.access.csv index 932c1a623f6..a22e6935e51 100644 --- a/addons/base_report_creator/security/ir.model.access.csv +++ b/addons/base_report_creator/security/ir.model.access.csv @@ -3,3 +3,4 @@ "access_base_report_creator_report_fields","base_report_creator.report.fields","model_base_report_creator_report_fields","base.group_system",1,1,1,1 "access_base_report_creator_report_filter","base_report_creator.report.filter","model_base_report_creator_report_filter","base.group_system",1,1,1,1 "access_report_menu_create","report.menu.create","model_report_menu_create","base.group_system",1,1,1,1 +"access_report_open","report.open","model_report_open","base.group_system",1,1,1,1 diff --git a/addons/base_report_creator/wizard/__init__.py b/addons/base_report_creator/wizard/__init__.py index 945d42586d1..d2ff1dc5fea 100644 --- a/addons/base_report_creator/wizard/__init__.py +++ b/addons/base_report_creator/wizard/__init__.py @@ -20,8 +20,7 @@ ############################################################################## import wiz_set_filter_fields -import base_report_creator_open import report_menu_create - +import report_open # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_report_creator/wizard/report_open.py b/addons/base_report_creator/wizard/report_open.py new file mode 100644 index 00000000000..4476c9d4e93 --- /dev/null +++ b/addons/base_report_creator/wizard/report_open.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 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 . +# +############################################################################## + +from osv import fields, osv + +class report_open(osv.osv_memory): + """ + Open report + """ + _name = "report.open" + _description = __doc__ + + def open_report(self, cr, uid, ids, context=None): + """ + This Function opens base creator report view + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of report open's IDs + @param context: A standard dictionary for contextual values + @return : Dictionary value for base creator report form + """ + + if not context: + context = {} + + context_id = context and context.get('active_id', False) or False + + if context.get('report_id', False): + raise osv.except_osv(_('UserError'), _('No Wizards available for this object!')) + + rep = self.pool.get('base_report_creator.report').browse(cr, uid, context_id, context) + view_mode = rep.view_type1 + + if rep.view_type2: + view_mode += ',' + rep.view_type2 + if rep.view_type3: + view_mode += ',' + rep.view_type3 + value = { + 'name': rep.name, + 'view_type': 'form', + 'view_mode': view_mode, + 'res_model': 'base_report_creator.report', + 'context': {'report_id': context_id}, + 'view_id': False, + 'type': 'ir.actions.act_window' + } + + return value + +report_open() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_report_creator/wizard/report_open_view.xml b/addons/base_report_creator/wizard/report_open_view.xml new file mode 100644 index 00000000000..7fcd413af00 --- /dev/null +++ b/addons/base_report_creator/wizard/report_open_view.xml @@ -0,0 +1,34 @@ + + + + + + + + report.open.form + report.open + form + +
+ + +