Invalid return against purchase invoice Error - Issue#11834 (#11835)

This commit is contained in:
vwithv1602 2017-12-04 11:16:34 +05:30 committed by Nabin Hait
parent 11938a47ec
commit 78d5ccf5fc

View File

@ -20,9 +20,9 @@ def validate_return_against(doc):
frappe.throw(_("{0} is mandatory for Return").format(doc.meta.get_label("return_against")))
else:
filters = {"doctype": doc.doctype, "docstatus": 1, "company": doc.company}
if doc.meta.get_field("customer"):
if doc.meta.get_field("customer") and doc.customer:
filters["customer"] = doc.customer
elif doc.meta.get_field("supplier"):
elif doc.meta.get_field("supplier") and doc.supplier:
filters["supplier"] = doc.supplier
if not frappe.db.exists(filters):