summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Colson <oco@odoo.com>2018-06-20 12:27:28 +0200
committerOlivier Colson <oco@odoo.com>2018-06-20 12:32:33 +0200
commitb81b9f9ca139fa707e46a75e7773faaa1964695e (patch)
treeb9c51650d8c261cf378f5fcc2246c9f09d5bb287
parent9a810565b0ca1bb8572c1742009d16277cdcccd4 (diff)
[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.
-rw-r--r--addons/account/models/account_invoice.py2
1 files changed, 1 insertions, 1 deletions
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]