[fix] do not check purchase invoice uniqueness for cancelled documents

This commit is contained in:
Rushabh Mehta 2015-10-15 11:37:34 +05:30
parent f94f153078
commit f861856ed9

View File

@ -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))