Merge pull request #12530 from frappe/manassolanki-patch-2

Issue in the data import while importing the invoice
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 01125f9..0032e80 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -26,7 +26,7 @@
 			now = now_datetime()
 			self.posting_date = now.strftime('%Y-%m-%d')
 			self.posting_time = now.strftime('%H:%M:%S.%f')
-		else:
+		elif self.posting_time:
 			try:
 				get_time(self.posting_time)
 			except ValueError: