From 82cef59fb38f1567171cacc0cb315976864cd71a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 2 Feb 2016 19:02:58 +0530 Subject: [PATCH] [fix] Purchase Return warehouse validation --- erpnext/controllers/sales_and_purchase_return.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index 868720a2e0..9e0dee8e3e 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