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
This commit is contained in:
Cédric Krier
2012-08-23 23:20:02 +02:00
parent a393cc7c6f
commit b52dee2841
+3
View File
@@ -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']