From 8b94f1b553504174634a5527d67e9f4878608625 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Mon, 8 Jan 2018 16:46:39 +0530 Subject: [PATCH] [minor][buying] fix schedule date check (#12375) --- erpnext/controllers/buying_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 9ece2ab120..63e55ee9a7 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -433,7 +433,8 @@ class BuyingController(StockController): if not d.schedule_date: d.schedule_date = self.schedule_date - if d.schedule_date and getdate(d.schedule_date) < getdate(self.transaction_date): + if (d.schedule_date and self.transaction_date and + getdate(d.schedule_date) < getdate(self.transaction_date)): frappe.throw(_("Row #{0}: Reqd by Date cannot be before Transaction Date").format(d.idx)) else: frappe.throw(_("Please enter Reqd by Date"))