mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
refactor: renamed args to pricing_ctx in set_transaction_type for clarity
(cherry picked from commit 6342e78305)
This commit is contained in:
@@ -682,23 +682,23 @@ def remove_pricing_rules(item_list):
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
def set_transaction_type(args):
|
def set_transaction_type(pricing_ctx: frappe._dict) -> None:
|
||||||
if args.transaction_type in ["buying", "selling"]:
|
if pricing_ctx.transaction_type in ["buying", "selling"]:
|
||||||
return
|
return
|
||||||
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
|
if pricing_ctx.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
|
||||||
args.transaction_type = "selling"
|
pricing_ctx.transaction_type = "selling"
|
||||||
elif args.doctype in (
|
elif pricing_ctx.doctype in (
|
||||||
"Material Request",
|
"Material Request",
|
||||||
"Supplier Quotation",
|
"Supplier Quotation",
|
||||||
"Purchase Order",
|
"Purchase Order",
|
||||||
"Purchase Receipt",
|
"Purchase Receipt",
|
||||||
"Purchase Invoice",
|
"Purchase Invoice",
|
||||||
):
|
):
|
||||||
args.transaction_type = "buying"
|
pricing_ctx.transaction_type = "buying"
|
||||||
elif args.customer:
|
elif pricing_ctx.customer:
|
||||||
args.transaction_type = "selling"
|
pricing_ctx.transaction_type = "selling"
|
||||||
else:
|
else:
|
||||||
args.transaction_type = "buying"
|
pricing_ctx.transaction_type = "buying"
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
Reference in New Issue
Block a user