Add methods to format number and symbol on Lang
and add format number with symbol on Report issue10730 review371831002
This commit is contained in:
+1
-1
@@ -706,7 +706,7 @@
|
||||
<text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text"></if></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table1.D5" office:value-type="string">
|
||||
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text"><(format_number(line.quantity, invoice.party.lang, digits=line.unit.digits if line.unit else None) + (line.unit and (' ' + line.unit.symbol) or '')) or ''></text:placeholder></text:p>
|
||||
<text:p text:style-name="P10"><text:placeholder text:placeholder-type="text"><format_number_symbol(line.quantity, invoice.party.lang, line.unit, digits=line.unit.digits) if line.unit else format_number(line.quantity, invoice.party.lang)></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Table1.D5" office:value-type="string">
|
||||
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text"><format_currency(line.unit_price, invoice.party.lang, invoice.currency, digits=line.__class__.unit_price.digits[1])></text:placeholder></text:p>
|
||||
|
||||
+3
-3
@@ -2302,9 +2302,9 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin):
|
||||
Lang = pool.get('ir.lang')
|
||||
if self.product:
|
||||
lang = Lang.get()
|
||||
prefix = (lang.format(
|
||||
'%.*f', (self.unit.digits, self.quantity or 0))
|
||||
+ '%s %s' % (self.unit.symbol, self.product.rec_name))
|
||||
prefix = (lang.format_number_symbol(
|
||||
self.quantity or 0, self.unit, digits=self.unit.digits)
|
||||
+ ' %s' % self.product.rec_name)
|
||||
elif self.account:
|
||||
prefix = self.account.rec_name
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user