summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxay Javiya <axj@odoo.com>2017-09-22 14:11:23 +0530
committerqdp-odoo <qdp@odoo.com>2017-09-29 13:50:58 +0200
commit28c3ffaa96c0ff4941c59ece58cf71e1063e93b8 (patch)
treea7f4a12b0fcf84be32b374c775bdc3d4f3b1587e
parenta2da1df78ed359de318ade08169db7d088ce722b (diff)
[IMP] account: in invoice set due_date value to invoice_date if due_date is not set at time of invoice validation
-rw-r--r--addons/account/models/account_invoice.py2
1 files changed, 2 insertions, 0 deletions
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)