Merge pull request #35142 from ruthra-kumar/fix_bypass_check_in_customer_group
fix: ineffective bypass flag for Credit Limit in Customer Group
This commit is contained in:
commit
6315d9f836
@ -617,11 +617,15 @@ def get_credit_limit(customer, company):
|
|||||||
|
|
||||||
if not credit_limit:
|
if not credit_limit:
|
||||||
customer_group = frappe.get_cached_value("Customer", customer, "customer_group")
|
customer_group = frappe.get_cached_value("Customer", customer, "customer_group")
|
||||||
credit_limit = frappe.db.get_value(
|
|
||||||
|
result = frappe.db.get_values(
|
||||||
"Customer Credit Limit",
|
"Customer Credit Limit",
|
||||||
{"parent": customer_group, "parenttype": "Customer Group", "company": company},
|
{"parent": customer_group, "parenttype": "Customer Group", "company": company},
|
||||||
"credit_limit",
|
fieldname=["credit_limit", "bypass_credit_limit_check"],
|
||||||
|
as_dict=True,
|
||||||
)
|
)
|
||||||
|
if result and not result[0].bypass_credit_limit_check:
|
||||||
|
credit_limit = result[0].credit_limit
|
||||||
|
|
||||||
if not credit_limit:
|
if not credit_limit:
|
||||||
credit_limit = frappe.get_cached_value("Company", company, "credit_limit")
|
credit_limit = frappe.get_cached_value("Company", company, "credit_limit")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user