mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
fix(pricing_rule): strict validation of transaction_type
This commit is contained in:
@@ -346,8 +346,7 @@ def apply_pricing_rule(args: str | dict, doc: str | dict | Document | None = Non
|
|||||||
|
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|
||||||
if not args.transaction_type:
|
set_transaction_type(args)
|
||||||
set_transaction_type(args)
|
|
||||||
|
|
||||||
# list of dictionaries
|
# list of dictionaries
|
||||||
out = []
|
out = []
|
||||||
@@ -689,7 +688,7 @@ def remove_pricing_rules(item_list: str | list):
|
|||||||
|
|
||||||
|
|
||||||
def set_transaction_type(args):
|
def set_transaction_type(args):
|
||||||
if args.transaction_type:
|
if args.transaction_type in ["buying", "selling"]:
|
||||||
return
|
return
|
||||||
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
|
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
|
||||||
args.transaction_type = "selling"
|
args.transaction_type = "selling"
|
||||||
|
|||||||
Reference in New Issue
Block a user