[REF] Account: cleaning

bzr revid: mra@mra-laptop-20101005042518-1uyc69u55bpyenmi
This commit is contained in:
Mustufa Rangwala 2010-10-05 09:55:18 +05:30
parent 2e3de2d694
commit 1bb8ea02bf
2 changed files with 11 additions and 10 deletions

View File

@ -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:

View File

@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). 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: