[Fix] account: Remove the sum_currency_amount_account

bzr revid: sbh@tinyerp.com-20100727121448-js956e6sc90gyy6g
This commit is contained in:
sbh (Open ERP) 2010-07-27 17:44:48 +05:30
parent 828edbdb5e
commit d33a109f3a
4 changed files with 2 additions and 31 deletions

View File

@ -61,7 +61,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
'sum_credit_account': self._sum_credit_account,
'sum_balance_account': self._sum_balance_account,
'get_children_accounts': self.get_children_accounts,
'sum_currency_amount_account': self._sum_currency_amount_account,
'get_fiscalyear': self._get_fiscalyear,
'get_journal': self._get_journal,
'get_account': self._get_account,
@ -215,19 +214,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
sum_balance += self.cr.fetchone()[0] or 0.0
return sum_balance
def _sum_currency_amount_account(self, account, form):
#FIXME: not working
self.cr.execute("SELECT sum(l.amount_currency) as tot_currency "\
"FROM account_move_line l "\
"WHERE l.account_id = %s AND %s"%(account.id, self.query))
sum_currency = self.cr.fetchone()[0] or 0.0
if form.get('initial_balance', False):
self.cr.execute("SELECT sum(l.amount_currency) as tot_currency "\
"FROM account_move_line l "\
"WHERE l.account_id = %s AND %s "%(account.id, form['initial_bal_query']))
# Add initial balance to the result
sum_currency += self.cr.fetchone()[0] or 0.0
return str(sum_currency)
def _get_sortby(self, data):
if self.sortby == 'sort_date':

View File

@ -52,7 +52,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
'get_start_period': self.get_start_period,
'get_end_period': self.get_end_period,
'get_sortby': self._get_sortby,
'sum_currency_amount_account': self._sum_currency_amount_account,
'get_filter': self._get_filter,
'get_journal': self._get_journal,
'get_start_date':self._get_start_date,
@ -64,17 +63,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
def get_abs(self,amount):
return abs(amount)
def _sum_currency_amount_account(self, account, form):
self._set_get_account_currency_code(account.id)
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,))
total = self.cr.fetchone()
if self.account_currency:
return_field = str(total[0]) + self.account_currency
return return_field
else:
currency_total = self.tot_currency = 0.0
return currency_total
def sum_dr(self):
if self.res_pl['type'] == 'Net Profit':
self.result_sum_dr += self.res_pl['balance']

View File

@ -1,4 +1,3 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@ -51,7 +50,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
'get_start_period': self.get_start_period,
'get_end_period': self.get_end_period,
'get_sortby': self._get_sortby,
'sum_currency_amount_account': self._sum_currency_amount_account,
'get_filter': self._get_filter,
'get_journal': self._get_journal,
'get_start_date':self._get_start_date,

View File

@ -49,7 +49,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
'get_filter': self._get_filter,
'get_start_date': self._get_start_date,
'get_end_date': self._get_end_date,
'sum_currency_amount_account': self._sum_currency_amount_account,
'get_fiscalyear': self._get_fiscalyear,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
@ -435,10 +434,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
header=False)
header='internal')
report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner',
'addons/account/report/third_party_ledger_other.rml',parser=third_party_ledger,
header=False)
header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: