diff --git a/addons/account/account.py b/addons/account/account.py index 208bf1d6f68..e90a8be6841 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2859,5 +2859,4 @@ class account_bank_accounts_wizard(osv.osv_memory): account_bank_accounts_wizard() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/report/voucher_print.py b/addons/account/report/voucher_print.py index 8d763837c1f..fbd05455e59 100644 --- a/addons/account/report/voucher_print.py +++ b/addons/account/report/voucher_print.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -21,22 +21,22 @@ ############################################################################## import time + from report import report_sxw from tools import amount_to_text_en class report_voucher_move(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(report_voucher_move, self).__init__(cr, uid, name, context) + def __init__(self, cr, uid, name, context=None): + super(report_voucher_move, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'convert':self.convert, 'get_title': self.get_title, 'debit':self.debit, 'credit':self.credit, - #'get_ref' : self._get_ref }) self.user=uid - + def convert(self, amount): user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0] cur = user_id.company_id.currency_id.name @@ -49,22 +49,24 @@ class report_voucher_move(report_sxw.rml_parse): type = voucher.journal_id.type title = type[0].swapcase() + type[1:] + " Voucher" return title - + def debit(self, move_ids): debit = 0.0 for move in move_ids: debit +=move.debit return debit - + def credit(self, move_ids): credit = 0.0 for move in move_ids: credit +=move.credit return credit - + report_sxw.report_sxw( 'report.account.move.voucher', 'account.move', 'addons/account/report/voucher_print.rml', parser=report_voucher_move,header="external" ) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file