[fixes] for tests
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py
index a99a8cf..f9a3b2f 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/asset/asset.py
@@ -188,7 +188,7 @@
 	pi = frappe.new_doc("Purchase Invoice")
 	pi.company = company
 	pi.currency = frappe.db.get_value("Company", company, "default_currency")
-	pi.set_posting_date = 1
+	pi.set_posting_time = 1
 	pi.posting_date = posting_date
 	pi.append("items", {
 		"item_code": item_code,
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index cb4a087..9a1af7f 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -1046,7 +1046,7 @@
 def create_sales_invoice(**args):
 	si = frappe.new_doc("Sales Invoice")
 	args = frappe._dict(args)
-	if si.posting_date:
+	if args.posting_date:
 		si.set_posting_date = 1
 	si.posting_date = args.posting_date or nowdate()
 
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
index cb3bb7b..e58042d 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
@@ -9,6 +9,9 @@
 	s = frappe.new_doc("Stock Entry")
 	args = frappe._dict(args)
 
+	if args.posting_date or args.posting_time:
+		s.set_posting_time = 1
+
 	if args.posting_date:
 		s.posting_date = args.posting_date
 	if args.posting_time:
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index d447482..688d6c4 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -18,7 +18,7 @@
 				frappe.db.get_value("Notification Control", None, dt + "_message"))
 
 	def validate_posting_time(self):
-		if not getattr(self, 'set_posting_time', False):
+		if not getattr(self, 'set_posting_time', None):
 			now = now_datetime()
 			self.posting_date = now.strftime('%Y-%m-%d')
 			self.posting_time = now.strftime('%H:%M:%S')