test: Pricing rule test for transactions

This commit is contained in:
Deepesh Garg 2022-04-07 13:20:53 +05:30
parent a6e26cce87
commit 22e8ae9dac

View File

@ -35,6 +35,7 @@ class PricingRule(Document):
self.margin_rate_or_amount = 0.0
def validate_duplicate_apply_on(self):
if self.apply_on != "Transaction":
field = apply_on_dict.get(self.apply_on)
values = [d.get(frappe.scrub(self.apply_on)) for d in self.get(field) if field]
if len(values) != len(set(values)):