[IMP]: Replace currency code with currency symbol.

bzr revid: rch@tinyerp.com-20101118122459-8wxos4t4lsifc840
This commit is contained in:
rch-openerp 2010-11-18 17:54:59 +05:30
parent 46571ed5a7
commit ad917be442
5 changed files with 15 additions and 15 deletions

View File

@ -312,7 +312,7 @@ class account_account(osv.osv):
def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}):
result = {}
for rec in self.browse(cr, uid, ids, context):
result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code)
result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.symbol)
return result
def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}):

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- This file must be loaded _after_ account_demo.xml ! -->
<!-- This file must be loaded _after_ account_demo.xml ! -->
<record id="test_invoice_1" model="account.invoice">
<field name="currency_id" ref="base.EUR"/>
<field name="company_id" ref="base.main_company"/>
@ -19,8 +19,8 @@
<field name="base">5.00</field>
<field name="amount">100.00</field>
<field name="account_id" ref="account.ova"/>
<field name="invoice_id" ref="test_invoice_1"/>
</record>
<field name="invoice_id" ref="test_invoice_1"/>
</record>
<record id="test_invoice_1_line_1" model="account.invoice.line">
<field name="name">Basic computer with Dvorak keyboard and left-handed mouse</field>
<field name="invoice_id" ref="test_invoice_1"/>
@ -34,19 +34,19 @@
<field name="price_unit">800</field>
<field name="quantity">2</field>
<field name="account_id" ref="account.a_sale"/>
</record>
</record>
<assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR">
<test expr="currency_id.code">EUR</test>
<test expr="currency_id.symbol"></test>
</assert>
<assert id="test_invoice_1" model="account.invoice" severity="error" string="The amount of Test invoice 1 is correct">
<test expr="sum([l.price_subtotal for l in invoice_line]) == 1850"/>
<test expr="sum([l.price_subtotal for l in invoice_line]) == amount_untaxed"/>
</assert>
<workflow action="invoice_open" model="account.invoice" ref="test_invoice_1"/>
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now open">
<test expr="state">open</test>
</assert>
@ -62,7 +62,7 @@
<!-- context = --> <value eval="{}"/>
<!-- name = --> <value eval="str('Payment from ASUStek')"/>
</function>
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now paid">
<test expr="state">paid</test>
</assert>

View File

@ -1232,7 +1232,7 @@ class account_invoice(osv.osv):
if (not round(total,self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))) or writeoff_acc_id:
self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context)
else:
code = invoice.currency_id.code
code = invoice.currency_id.symbol
# TODO: use currency's formatting function
msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)") % \
(name, pay_amount, code, invoice.amount_total, code, total, code)

View File

@ -301,7 +301,7 @@
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</u></para></td>
</tr>
</blockTable>
</td>

View File

@ -136,7 +136,7 @@ class common_report_header(object):
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 ''
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.symbol
return ''
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: