mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-25 04:53:01 +00:00
chore: remove past module dependencies
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
import functools
|
||||
import json
|
||||
import os
|
||||
|
||||
@@ -13,7 +12,6 @@ from frappe.cache_manager import clear_defaults_cache
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.utils import cint, formatdate, get_timestamp, today
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
from past.builtins import cmp
|
||||
|
||||
from erpnext.accounts.doctype.account.account import get_account_currency
|
||||
from erpnext.setup.setup_wizard.operations.taxes_setup import setup_taxes_and_charges
|
||||
@@ -583,7 +581,7 @@ def get_default_company_address(name, sort_key='is_primary_address', existing_ad
|
||||
return existing_address
|
||||
|
||||
if out:
|
||||
return sorted(out, key = functools.cmp_to_key(lambda x,y: cmp(y[1], x[1])))[0][0]
|
||||
return min(out, key=lambda x: x[1])[0] # find min by sort_key
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user