Merge pull request #48194 from iamkhanraheel/fix-party-specific-exist-filter

fix: filter to validate existing item in Party Specific Item
This commit is contained in:
rohitwaghchaure
2025-06-23 16:49:46 +05:30
committed by GitHub

View File

@@ -23,13 +23,13 @@ class PartySpecificItem(Document):
def validate(self): def validate(self):
exists = frappe.db.exists( exists = frappe.db.exists(
"Party Specific Item",
{ {
"doctype": "Party Specific Item",
"party_type": self.party_type, "party_type": self.party_type,
"party": self.party, "party": self.party,
"restrict_based_on": self.restrict_based_on, "restrict_based_on": self.restrict_based_on,
"based_on": self.based_on_value, "based_on_value": self.based_on_value,
} },
) )
if exists: if exists:
frappe.throw(_("This item filter has already been applied for the {0}").format(self.party_type)) frappe.throw(_("This item filter has already been applied for the {0}").format(self.party_type))