From 6192af5cf04e2cec18cc6cb012adb779a0d2966b Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 8 Dec 2022 18:04:40 +0530 Subject: [PATCH] chore: Update tests --- erpnext/accounts/doctype/pricing_rule/utils.py | 8 +++++++- erpnext/stock/get_item_details.py | 2 +- erpnext/utilities/product.py | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index ab1d4d3fa1b..3989f8a8ac2 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -250,7 +250,13 @@ def get_other_conditions(conditions, values, args): and ifnull(`tabPricing Rule`.valid_upto, '2500-12-31')""" values["transaction_date"] = args.get("transaction_date") - if args.get("doctype") in ["Sales Order", "Delivery Note", "Sales Invoice", "POS Invoice"]: + if args.get("doctype") in [ + "Quotation", + "Sales Order", + "Delivery Note", + "Sales Invoice", + "POS Invoice", + ]: conditions += """ and ifnull(`tabPricing Rule`.selling, 0) = 1""" else: conditions += """ and ifnull(`tabPricing Rule`.buying, 0) = 1""" diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index a9e8db07424..31dccf6944d 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -113,7 +113,7 @@ def get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=Tru if args.get(key) is None: args[key] = value - data = get_pricing_rule_for_item(args, doc, for_validate=for_validate) + data = get_pricing_rule_for_item(args, doc=doc, for_validate=for_validate) out.update(data) diff --git a/erpnext/utilities/product.py b/erpnext/utilities/product.py index 04ee0b3b1eb..afe9654e8ea 100644 --- a/erpnext/utilities/product.py +++ b/erpnext/utilities/product.py @@ -110,6 +110,7 @@ def get_price(item_code, price_list, customer_group, company, qty=1): "conversion_rate": 1, "for_shopping_cart": True, "currency": frappe.db.get_value("Price List", price_list, "currency"), + "doctype": "Quotation", } )