[FIX] account: use today's date as due date for invoices if there is no payment term and no due date was given manually

The code was actually alreadt made in this spirit, there was just as wrong call to the date_invoice field of the model instead of the local variable with the same name, which contained the right value.
This commit is contained in:
Olivier Colson
2018-06-20 12:32:33 +02:00
parent 9a810565b0
commit b81b9f9ca1
+1 -1
View File
@@ -540,7 +540,7 @@ class AccountInvoice(models.Model):
date_invoice = fields.Date.context_today(self)
if not self.payment_term_id:
# When no payment term defined
self.date_due = self.date_due or self.date_invoice
self.date_due = self.date_due or date_invoice
else:
pterm = self.payment_term_id
pterm_list = pterm.with_context(currency_id=self.company_id.currency_id.id).compute(value=1, date_ref=date_invoice)[0]