Skip to content

Commit

Permalink
Merge pull request #35356 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-35142

fix: ineffective bypass flag for Credit Limit in Customer Group (backport #35142)
  • Loading branch information
ruthra-kumar authored May 18, 2023
2 parents 7506132 + f0c9d89 commit 6191cfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions erpnext/selling/doctype/customer/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,15 @@ def get_credit_limit(customer, company):

if not credit_limit:
customer_group = frappe.get_cached_value("Customer", customer, "customer_group")
credit_limit = frappe.db.get_value(

result = frappe.db.get_values(
"Customer Credit Limit",
{"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:
credit_limit = frappe.get_cached_value("Company", company, "credit_limit")
Expand Down

0 comments on commit 6191cfe

Please sign in to comment.