From b81b9f9ca139fa707e46a75e7773faaa1964695e Mon Sep 17 00:00:00 2001 From: Olivier Colson Date: Wed, 20 Jun 2018 12:27:28 +0200 Subject: [PATCH] [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. --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index f81cb6c432e..240d63ea7fc 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -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]