1
##############################################################################
3
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
5
# $Id: rappel.py 2514 2006-03-23 07:33:22Z pinky $
7
# WARNING: This program as such is intended to be used by professional
8
# programmers who take the whole responsability of assessing all potential
9
# consequences resulting from its eventual inadequacies and bugs
10
# End users who are looking for a ready-to-use solution with commercial
11
# garantees and support are strongly adviced to contract a Free Software
14
# This program is Free Software; you can redistribute it and/or
15
# modify it under the terms of the GNU General Public License
16
# as published by the Free Software Foundation; either version 2
17
# of the License, or (at your option) any later version.
19
# This program is distributed in the hope that it will be useful,
20
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
# GNU General Public License for more details.
24
# You should have received a copy of the GNU General Public License
25
# along with this program; if not, write to the Free Software
26
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
##############################################################################
34
from report import report_sxw
36
class report_rappel(report_sxw.rml_parse):
37
def __init__(self, cr, uid, name, context):
38
super(report_rappel, self).__init__(cr, uid, name, context)
39
self.localcontext.update( {
41
'ids_to_objects': self._ids_to_objects,
42
'adr_get' : self._adr_get,
43
'getLines' : self._lines_get,
46
def _ids_to_objects(self, partners_ids):
47
toto = pooler.get_pool(self.cr.dbname).get('res.partner').browse(self.cr, self.uid, partners_ids)
50
def _adr_get(self, partner, type):
51
res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
52
res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
53
adr = res_partner.address_get(self.cr, self.uid, [partner.id], [type])[type]
54
return res_partner_address.read(self.cr, self.uid, [adr])[0]
56
def _lines_get(self, partner):
57
acc = partner.property_account_receivable[0]
58
moveline_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
59
movelines = moveline_obj.search(self.cr, self.uid, [('partner_id','=',partner.id), ('account_id','=',acc), ('state','=','valid')])
60
movelines = moveline_obj.read(self.cr, self.uid, movelines)
63
report_sxw.report_sxw('report.account_followup.followup.print', 'res.partner', 'addons/account_followup/report/rappel.rml',parser=report_rappel)