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
@@ -674,7 +674,7 @@
|
||||
<text:p text:style-name="P24"><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="P12"><text:placeholder text:placeholder-type="text"><(format_number(line.quantity, purchase.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="P12"><text:placeholder text:placeholder-type="text"><format_number_symbol(line.quantity, purchase.party.lang, line.unit, digits=line.unit.digits) if line.unit else format_number(line.quantity, purchase.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="P13"><text:placeholder text:placeholder-type="text"><format_currency(line.unit_price, purchase.party.lang, purchase.currency, digits=line.__class__.unit_price.digits[1])></text:placeholder></text:p>
|
||||
|
||||
+3
-5
@@ -1698,11 +1698,9 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
Lang = pool.get('ir.lang')
|
||||
if self.product:
|
||||
lang = Lang.get()
|
||||
return (lang.format(
|
||||
'%.*f', (self.unit.digits, self.quantity or 0))
|
||||
+ '%s %s @ %s' % (
|
||||
self.unit.symbol, self.product.rec_name,
|
||||
self.purchase.rec_name))
|
||||
return (lang.format_number_symbol(
|
||||
self.quantity or 0, self.unit, digits=self.unit.digits)
|
||||
+ ' %s @ %s' % (self.product.rec_name, self.purchase.rec_name))
|
||||
else:
|
||||
return self.purchase.rec_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user