1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Author: Romain Deheele. Copyright Camptocamp SA
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as
8
# published by the Free Software Foundation, either version 3 of the
9
# License, or (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
##############################################################################
21
from openerp import pooler
22
from openerp.addons.report_webkit import webkit_report
24
class MultiBvrWebKitParser(webkit_report.WebKitParser):
26
def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None):
27
self.pool = pooler.get_pool(cursor.dbname)
28
target_obj = 'account.move.line'
29
move_line_obj = self.pool.get(target_obj)
30
account_obj = self.pool.get('account.account')
31
invoice_obj = self.pool.get('account.invoice')
32
inv = invoice_obj.browse(cursor, uid, ids[0],context)
33
tier_account_id = account_obj.search(cursor, uid, [('type', 'in', ['receivable', 'payable'])])
34
move_lines = move_line_obj.search(cursor, uid, [('move_id', '=', inv.move_id.id), ('account_id', 'in', tier_account_id)])
35
context['active_model'] = self.table = target_obj
36
context['active_ids'] = ids = move_lines
37
return super(MultiBvrWebKitParser, self).create_single_pdf(cursor, uid, ids, data, report_xml, context)
b'\\ No newline at end of file'