Merge pull request #12347 from pratu16x7/buying-fix

[minor][buying] fix schedule date check
This commit is contained in:
Prateeksha Singh 2018-01-05 21:31:58 +05:30 committed by GitHub
commit 620e0981cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,7 +447,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"))