Duplicate supplier delivery number validation in Purchase Receipt should happen per financial year
This commit is contained in:
parent
21ae930b4c
commit
0549b1c5c9
@ -92,10 +92,9 @@ class PurchaseReceipt(BuyingController):
|
|||||||
def validate_challan_no(self):
|
def validate_challan_no(self):
|
||||||
"Validate if same challan no exists for same supplier in a submitted purchase receipt"
|
"Validate if same challan no exists for same supplier in a submitted purchase receipt"
|
||||||
if self.challan_no:
|
if self.challan_no:
|
||||||
exists = frappe.db.sql_list("""
|
exists = frappe.db.sql_list("""select name from `tabPurchase Receipt`
|
||||||
SELECT name FROM `tabPurchase Receipt`
|
where docstatus=1 and name!=%s and supplier=%s and challan_no=%s
|
||||||
WHERE name!=%s AND supplier=%s AND challan_no=%s
|
and fiscal_year=%s""", (self.name, self.supplier, self.challan_no, self.doc.fiscal_year))
|
||||||
AND docstatus=1""", (self.name, self.supplier, self.challan_no))
|
|
||||||
if exists:
|
if exists:
|
||||||
frappe.throw(_("Supplier delivery number duplicate in {0}").format(exists))
|
frappe.throw(_("Supplier delivery number duplicate in {0}").format(exists))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user