1
##############################################################################
3
# Copyright (c) 2008-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
4
# General contacts <info@alistek.com>
6
# WARNING: This program as such is intended to be used by professional
7
# programmers who take the whole responsability of assessing all potential
8
# consequences resulting from its eventual inadequacies and bugs
9
# End users who are looking for a ready-to-use solution with commercial
10
# garantees and support are strongly adviced to contract a Free Software
13
# This program is Free Software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 3
16
# of the License, or (at your option) any later version.
18
# This module is GPLv3 or newer and incompatible
19
# with OpenERP SA "AGPL + Private Use License"!
21
# This program is distributed in the hope that it will be useful,
22
# but WITHOUT ANY WARRANTY; without even the implied warranty of
23
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
# GNU General Public License for more details.
26
# You should have received a copy of the GNU General Public License
27
# along with this program; if not, write to the Free Software
28
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30
##############################################################################
34
from osv import fields
36
class report_print_by_action(osv.osv_memory):
37
_name = 'aeroo.print_by_action'
39
def to_print(self, cr, uid, ids, context=None):
40
this = self.browse(cr, uid, ids[0], context=context)
41
report_xml = self.pool.get(context['active_model']).browse(cr, uid, context['active_id'], context=context)
42
print_ids = eval("[%s]" % this.object_ids, {})
43
data = {'model':report_xml.model, 'ids':print_ids, 'id':print_ids[0], 'report_type': 'aeroo'}
45
'type': 'ir.actions.report.xml',
46
'report_name': report_xml.report_name,
52
'name':fields.text('Object Model', readonly=True),
53
'object_ids':fields.char('Object IDs', size=250, required=True, help="Comma separated records ID"),
57
def _get_model(self, cr, uid, context):
58
return self.pool.get(context['active_model']).read(cr, uid, context['active_id'], ['model'], context=context)['model']
64
report_print_by_action()