mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fix: use max function to get default company address
This commit is contained in:
@@ -808,7 +808,7 @@ def get_default_company_address(name, sort_key="is_primary_address", existing_ad
|
|||||||
return existing_address
|
return existing_address
|
||||||
|
|
||||||
if out:
|
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:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user