Skip to content

Commit

Permalink
fix: use max function to get default company address
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekkaramchandani committed Feb 17, 2023
1 parent 6b3028d commit b93c18b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/setup/doctype/company/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def get_default_company_address(name, sort_key="is_primary_address", existing_ad
return existing_address

if out:
return min(out, key=lambda x: x[1])[0] # find min by sort_key
return max(out, key=lambda x: x[1])[0] # find max by sort_key
else:
return None

Expand Down

0 comments on commit b93c18b

Please sign in to comment.