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 7c7f216fe4
commit a1b1ee02bc
+3 -4
View File
@@ -210,10 +210,9 @@ class ComponentMixin(sequence_ordered(), ModelStorage):
pool = Pool()
Lang = pool.get('ir.lang')
lang = Lang.get()
return (lang.format(
'%.*f', (self.unit.digits, self.quantity))
+ '%s %s' % (
self.unit.symbol, self.product.rec_name))
return (lang.format_number_symbol(
self.quantity, self.unit, digits=self.unit.digits)
+ ' %s' % self.product.rec_name)
@classmethod
def search_rec_name(cls, name, clause):