chore: remove past module dependencies

This commit is contained in:
Ankush Menat
2021-11-04 18:49:06 +05:30
parent 6098e92ba9
commit 897e90ac55
3 changed files with 7 additions and 7 deletions

View File

@@ -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