[fix] do not check purchase invoice uniqueness for cancelled documents
This commit is contained in:
parent
f94f153078
commit
f861856ed9
@ -421,7 +421,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if self.bill_no:
|
if self.bill_no:
|
||||||
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
|
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
|
||||||
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no,
|
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:
|
if pi:
|
||||||
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
|
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user