mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-27 10:38:30 +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
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user