mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
[fix] do not check purchase invoice uniqueness for cancelled documents
This commit is contained in:
@@ -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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user