From bbc4a49bda48d7a2f1be915c3191faa21e862bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 24 Sep 2018 14:43:59 +0200 Subject: [PATCH] Use origin instead of description when paying invoice The payment move on an invoice must be linked to the invoice with the origin field and let the description as free text for the user. As there is only one description for the move, it should be stored on the move instead of the line. issue7702 review46641002 --- invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invoice.py b/invoice.py index e63f69eb32..08459aac40 100644 --- a/invoice.py +++ b/invoice.py @@ -1192,8 +1192,8 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): Line = pool.get('account.move.line') Period = pool.get('account.period') - line1 = Line(description=description, account=self.account) - line2 = Line(description=description) + line1 = Line(account=self.account) + line2 = Line() lines = [line1, line2] if amount >= 0: @@ -1226,6 +1226,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): move = Move( journal=payment_method.journal, period=period_id, date=date, + origin=self, description=description, company=self.company, lines=lines) move.save() Move.post([move]) @@ -2603,7 +2604,6 @@ class PayInvoice(Wizard): default['currency_digits'] = invoice.currency.digits default['amount'] = (invoice.amount_to_pay_today or invoice.amount_to_pay) - default['description'] = invoice.number default['invoice_account'] = invoice.account.id return default