diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 868720a2e08..9e0dee8e3ea 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -97,7 +97,7 @@ def validate_returned_items(doc): frappe.throw(_("Row # {0}: Serial No {1} does not match with {2} {3}") .format(d.idx, s, doc.doctype, doc.return_against)) - if not d.warehouse: + if doc.doctype != "Purchase Invoice" and not d.get("warehouse"): frappe.throw(_("Warehouse is mandatory")) items_returned = True