Skip to content

Commit 396727e

Browse files
diptanilsahamergify[bot]
authored andcommitted
fix(pricing_rule): strict validation of transaction_type
(cherry picked from commit 7ec0354)
1 parent ad3411b commit 396727e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

erpnext/accounts/doctype/pricing_rule/pricing_rule.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ def apply_pricing_rule(args, doc=None):
346346

347347
args = frappe._dict(args)
348348

349-
if not args.transaction_type:
350-
set_transaction_type(args)
349+
set_transaction_type(args)
351350

352351
# list of dictionaries
353352
out = []
@@ -684,7 +683,7 @@ def remove_pricing_rules(item_list):
684683

685684

686685
def set_transaction_type(args):
687-
if args.transaction_type:
686+
if args.transaction_type in ["buying", "selling"]:
688687
return
689688
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
690689
args.transaction_type = "selling"

0 commit comments

Comments
 (0)