From 185cec90dc350d7aac5adfe2970887cb930ea540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 26 Nov 2019 22:20:24 +0100 Subject: [PATCH] Display quantity in record name issue8797 review274151002 --- invoice.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index 1bfadb861b..37142bd860 100644 --- a/invoice.py +++ b/invoice.py @@ -2030,8 +2030,13 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): return [(None, '')] + [(m.model, m.name) for m in models] def get_rec_name(self, name): + pool = Pool() + Lang = pool.get('ir.lang') if self.product: - prefix = self.product.rec_name + lang = Lang.get() + prefix = (lang.format( + '%.*f', (self.unit.digits, self.quantity or 0)) + + '%s %s' % (self.unit.symbol, self.product.rec_name)) elif self.account: prefix = self.account.rec_name else: