mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
Skip validate_duplicate_apply_on if not necessary (#20128)
Skip the validation of duplicate fields if the type is transaction, for example.
This commit is contained in:
@@ -34,6 +34,9 @@ class PricingRule(Document):
|
||||
|
||||
def validate_duplicate_apply_on(self):
|
||||
field = apply_on_dict.get(self.apply_on)
|
||||
if not field:
|
||||
return False
|
||||
|
||||
values = [d.get(frappe.scrub(self.apply_on)) for d in self.get(field)]
|
||||
|
||||
if len(values) != len(set(values)):
|
||||
|
||||
Reference in New Issue
Block a user