chore: remove all six compat code

This commit is contained in:
Ankush Menat
2021-11-04 19:48:32 +05:30
parent 56a25a0c4f
commit 8fe5feb6a4
420 changed files with 179 additions and 678 deletions

View File

@@ -1,4 +1,3 @@
from frappe import _

View File

@@ -17,7 +17,6 @@ test_ignore = ["Price List"]
test_dependencies = ['Payment Term', 'Payment Terms Template']
test_records = frappe.get_test_records('Customer')
from six import iteritems
class TestCustomer(unittest.TestCase):
@@ -90,7 +89,7 @@ class TestCustomer(unittest.TestCase):
details = get_party_details("_Test Customer")
for key, value in iteritems(to_check):
for key, value in to_check.items():
val = details.get(key)
if not val and not isinstance(val, list):
val = None

View File

@@ -1,4 +1,3 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

View File

@@ -1,4 +1,3 @@
from frappe import _

View File

@@ -12,7 +12,6 @@ from frappe.desk.notifications import clear_doctype_notifications
from frappe.model.mapper import get_mapped_doc
from frappe.model.utils import get_fetch_values
from frappe.utils import add_days, cint, cstr, flt, get_link_to_form, getdate, nowdate, strip_html
from six import string_types
from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
unlink_inter_company_doc,
@@ -790,7 +789,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
"""Creates Purchase Order for each Supplier. Returns a list of doc objects."""
if not selected_items: return
if isinstance(selected_items, string_types):
if isinstance(selected_items, str):
selected_items = json.loads(selected_items)
def set_missing_values(source, target):
@@ -891,7 +890,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
def make_purchase_order(source_name, selected_items=None, target_doc=None):
if not selected_items: return
if isinstance(selected_items, string_types):
if isinstance(selected_items, str):
selected_items = json.loads(selected_items)
items_to_map = [item.get('item_code') for item in selected_items if item.get('item_code') and item.get('item_code')]
@@ -1045,7 +1044,7 @@ def make_raw_material_request(items, company, sales_order, project=None):
if not frappe.has_permission("Sales Order", "write"):
frappe.throw(_("Not permitted"), frappe.PermissionError)
if isinstance(items, string_types):
if isinstance(items, str):
items = frappe._dict(json.loads(items))
for item in items.get('items'):

View File

@@ -1,4 +1,3 @@
from frappe import _

View File

@@ -3,8 +3,6 @@
import frappe
from six import iteritems
from six.moves import range
field_map = {
"Contact": [ "first_name", "last_name", "phone", "mobile_no", "email_id", "is_primary_contact" ],
@@ -66,7 +64,7 @@ def get_party_addresses_and_contact(party_type, party, party_group):
party_details = get_party_details(party_type, party_list, "Address", party_details)
party_details = get_party_details(party_type, party_list, "Contact", party_details)
for party, details in iteritems(party_details):
for party, details in party_details.items():
addresses = details.get("address", [])
contacts = details.get("contact", [])
if not any([addresses, contacts]):

View File

@@ -5,7 +5,6 @@
import frappe
from frappe import _, scrub
from frappe.utils import add_days, add_to_date, flt, getdate
from six import iteritems
from erpnext.accounts.utils import get_fiscal_year
@@ -226,7 +225,7 @@ class Analytics(object):
self.data = []
self.get_periodic_data()
for entity, period_data in iteritems(self.entity_periodic_data):
for entity, period_data in self.entity_periodic_data.items():
row = {
"entity": entity,
"entity_name": self.entity_names.get(entity) if hasattr(self, 'entity_names') else None