From 28c3ffaa96c0ff4941c59ece58cf71e1063e93b8 Mon Sep 17 00:00:00 2001 From: Axay Javiya Date: Fri, 22 Sep 2017 14:11:23 +0530 Subject: [PATCH] [IMP] account: in invoice set due_date value to invoice_date if due_date is not set at time of invoice validation --- addons/account/models/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index ae986406810..3610dafc605 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1069,6 +1069,8 @@ class AccountInvoice(models.Model): if not inv.date_invoice: inv.with_context(ctx).write({'date_invoice': fields.Date.context_today(self)}) + if not inv.date_due: + inv.with_context(ctx).write({'date_due': inv.date_invoice}) company_currency = inv.company_id.currency_id # create move lines (one per invoice line + eventual taxes and analytic lines)