Add methods to format number and symbol on Lang

and add format number with symbol on Report

issue10730
review371831002
This commit is contained in:
Maxime Richez
2021-10-04 18:52:01 +02:00
parent e6113342a5
commit 5114196fde
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -469,7 +469,7 @@
<text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text">&lt;move.product.rec_name&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.D4" office:value-type="string">
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number(move.quantity, user.language, digits=move.unit_digits)&gt;</text:placeholder> <text:placeholder text:placeholder-type="text">&lt;move.uom.symbol&gt;</text:placeholder></text:p>
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(move.quantity, user.language, move.uom, digits=move.uom.digits)&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
+1 -1
View File
@@ -475,7 +475,7 @@
<text:p text:style-name="P13"><text:placeholder text:placeholder-type="text">&lt;move.product.rec_name&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.B3" office:value-type="string">
<text:p text:style-name="P12"><text:placeholder text:placeholder-type="text">&lt;format_number(move.quantity, shipment.delivery_address.party.lang, digits=move.uom.digits)&gt;</text:placeholder><text:s/><text:placeholder text:placeholder-type="text">&lt;move.uom.symbol&gt;</text:placeholder></text:p>
<text:p text:style-name="P12"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(move.quantity, shipment.delivery_address.party.lang, move.uom, digits=move.uom.digits)&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
+1 -1
View File
@@ -506,7 +506,7 @@
<text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text">&lt;move.product.rec_name&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.D4" office:value-type="string">
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number(move.quantity, user.language, digits=move.uom.digits)&gt;</text:placeholder><text:s/><text:placeholder text:placeholder-type="text">&lt;move.uom.symbol&gt;</text:placeholder></text:p>
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(move.quantity, user.language, move.uom, digits=move.uom.digits)&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
+3 -3
View File
@@ -551,9 +551,9 @@ class Move(Workflow, ModelSQL, ModelView):
pool = Pool()
Lang = pool.get('ir.lang')
lang = Lang.get()
return (lang.format(
'%.*f', (self.uom.digits, self.quantity))
+ '%s %s' % (self.uom.symbol, self.product.rec_name))
return (lang.format_number_symbol(
self.quantity, self.uom, digits=self.uom.digits)
+ ' %s' % self.product.rec_name)
@classmethod
def search_rec_name(cls, name, clause):
+1 -1
View File
@@ -468,7 +468,7 @@
<text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text">&lt;move.product.rec_name&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.D4" office:value-type="string">
<text:p text:style-name="P12"><text:placeholder text:placeholder-type="text">&lt;format_number(move.quantity, user.language, digits=move.uom.digits)&gt;</text:placeholder> <text:placeholder text:placeholder-type="text">&lt;move.uom.symbol&gt;</text:placeholder></text:p>
<text:p text:style-name="P12"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(move.quantity, user.language, move.uom, digits=move.uom.digits)&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>
+1 -1
View File
@@ -460,7 +460,7 @@
<text:p text:style-name="Table_20_Contents"><text:placeholder text:placeholder-type="text">&lt;move.product.rec_name&gt;</text:placeholder></text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.D4" office:value-type="string">
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number(move.quantity, user.language, digits=move.uom.digits)&gt;</text:placeholder> <text:placeholder text:placeholder-type="text">&lt;move.uom.symbol&gt;</text:placeholder></text:p>
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(move.quantity, user.language, move.uom, digits=move.uom.digits)&gt;</text:placeholder></text:p>
</table:table-cell>
</table:table-row>
<table:table-row>