From b0df661e81f76687986267b75c53cb9f2bf60599 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Tue, 16 May 2017 07:59:58 +0530 Subject: [PATCH] [minor] set set_posting_time to 1 while data import (#8835) --- erpnext/utilities/transaction_base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 9a25b76cbe..7657188bb0 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -18,6 +18,10 @@ class TransactionBase(StatusUpdater): frappe.db.get_value("Notification Control", None, dt + "_message")) def validate_posting_time(self): + # set Edit Posting Date and Time to 1 while data import + if frappe.flags.in_import: + self.set_posting_time = 1 + if not getattr(self, 'set_posting_time', None): now = now_datetime() self.posting_date = now.strftime('%Y-%m-%d')