[REF] : move the get_currency function into common

bzr revid: sbh@tinyerp.com-20100728070949-k9fx6hr8w8nic02d
This commit is contained in:
sbh (Open ERP) 2010-07-28 12:39:49 +05:30
parent 05b7303ecd
commit d755fadb28
5 changed files with 5 additions and 18 deletions

View File

@ -127,4 +127,9 @@ class common_report_header(object):
codes = [x for x, in self.cr.fetchall()]
return codes
def _get_currency(self, data):
if data.get('form', False) and data['form'].get('chart_account_id', False):
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.code
return ''
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -533,11 +533,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
debit, credit = self._sum_debit(data), self._sum_credit(data)
return credit > debit and credit - debit
def _get_currency(self, data):
if data.get('form', False) and data['form'].get('chart_account_id', False):
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.code
return ''
def _get_partners(self, data):
if data['form']['result_selection']=='customer':
return 'Receivable Accounts'

View File

@ -199,11 +199,6 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
def get_lines_another(self, group):
return self.result.get(group, [])
def _get_currency(self, data):
if data.get('form', False) and data['form'].get('chart_account_id', False):
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.code
return ''
report_sxw.report_sxw('report.account.balancesheet.horizontal', 'account.account',
'addons/account/report/report_balance_sheet_horizontal.rml',parser=report_balancesheet_horizontal,
header='internal')

View File

@ -173,11 +173,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
def get_lines_another(self, group):
return self.result.get(group, [])
def _get_currency(self, data):
if data.get('form', False) and data['form'].get('chart_account_id', False):
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.code
report_sxw.report_sxw('report.pl.account.horizontal', 'account.account',
'addons/account/report/report_pl_account_horizontal.rml',parser=report_pl_account_horizontal, header=False)

View File

@ -408,9 +408,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
# def _get_company(self, form):
# return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
def _get_currency(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
def _get_partners(self, data):
if data['form']['result_selection']=='customer':
return 'Receivable Accounts'