From f861856ed9a1a8c5f868cffe6d1f18c54ab09158 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 15 Oct 2015 11:37:34 +0530 Subject: [PATCH] [fix] do not check purchase invoice uniqueness for cancelled documents --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 5697b778ed7..d4a5fa179b4 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -421,7 +421,7 @@ class PurchaseInvoice(BuyingController): if self.bill_no: if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")): pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no, - "fiscal_year": self.fiscal_year, "name": ("!=", self.name)}) + "fiscal_year": self.fiscal_year, "name": ("!=", self.name), "docstatus": ("<", 2)}) if pi: frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))