From b52dee28415aca301bf99ba15962b784abff2dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Aug 2012 23:20:02 +0200 Subject: [PATCH] reate a move line even when there is no terms It is required to have a receivable/payable line even with zero value to track reconciliation. issue2567 review476003 --- invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invoice.py b/invoice.py index 30d89c5c1e..fdbc1046bd 100644 --- a/invoice.py +++ b/invoice.py @@ -858,6 +858,7 @@ class Invoice(Workflow, ModelSQL, ModelView): currency_obj = pool.get('currency.currency') move_obj = pool.get('account.move') period_obj = pool.get('account.period') + date_obj = pool.get('ir.date') if invoice.move: return True @@ -874,6 +875,8 @@ class Invoice(Workflow, ModelSQL, ModelView): term_lines = payment_term_obj.compute(total, invoice.company.currency, invoice.payment_term, invoice.invoice_date) remainder_total_currency = total_currency + if not term_lines: + term_lines = [(date_obj.today(), total)] for date, amount in term_lines: val = self._get_move_line(invoice, date, amount) remainder_total_currency -= val['amount_second_currency']