From 2cf1699937e2f43fc77d7de452b1959ead1dc533 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 17 Nov 2015 17:32:07 +0530 Subject: [PATCH] [fix] Check Purchase Receipt mandatory only for stock items --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 91b01d5103..5119a3aa0e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -176,9 +176,10 @@ class PurchaseInvoice(BuyingController): throw(_("Purchse Order number required for Item {0}").format(d.item_code)) def pr_required(self): + stock_items = self.get_stock_items() if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes': for d in self.get('items'): - if not d.purchase_receipt: + if not d.purchase_receipt and d.item_code in stock_items: throw(_("Purchase Receipt number required for Item {0}").format(d.item_code)) def validate_write_off_account(self):