chore: remove all six compat code
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index a431829..9d99ebb 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -1,4 +1,3 @@
-
 import inspect
 
 import frappe
diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py
index 3afa0ce..5df8269 100644
--- a/erpnext/accounts/deferred_revenue.py
+++ b/erpnext/accounts/deferred_revenue.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 from frappe.email import sendmail_to_system_managers
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index 3a55143..a8de06c 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe.utils import cstr
 from frappe.utils.nestedset import rebuild_tree
-from six import iteritems
 from unidecode import unidecode
 
 
@@ -17,7 +16,7 @@
 		accounts = []
 
 		def _import_accounts(children, parent, root_type, root_account=False):
-			for account_name, child in iteritems(children):
+			for account_name, child in children.items():
 				if root_account:
 					root_type = child.get("root_type")
 
@@ -200,7 +199,7 @@
 
 	if chart:
 		def _get_account_names(account_master):
-			for account_name, child in iteritems(account_master):
+			for account_name, child in account_master.items():
 				if account_name not in ["account_number", "account_type",
 					"root_type", "is_group", "tax_rate"]:
 					accounts.append(account_name)
@@ -223,7 +222,7 @@
 	accounts = []
 	def _import_accounts(children, parent):
 		''' recursively called to form a parent-child based list of dict from chart template '''
-		for account_name, child in iteritems(children):
+		for account_name, child in children.items():
 			account = {}
 			if account_name in ["account_name", "account_number", "account_type",\
 				"root_type", "is_group", "tax_rate"]: continue
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py b/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py
index 7d94c89..79001d7 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/import_from_openerp.py
@@ -12,7 +12,6 @@
 
 import frappe
 from frappe.utils.csvutils import read_csv_content
-from six import iteritems
 
 path = "/Users/nabinhait/projects/odoo/addons"
 
@@ -139,7 +138,7 @@
 
 def make_maps_for_xml(xml_roots, account_types, country_dir):
 	"""make maps for `charts` and `accounts`"""
-	for model, root_list in iteritems(xml_roots):
+	for model, root_list in xml_roots.items():
 		for root in root_list:
 			for node in root[0].findall("record"):
 				if node.get("model")=="account.account.template":
diff --git a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
index eb90fc7..bf1e967 100644
--- a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
+++ b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/accounts/doctype/bank/bank_dashboard.py b/erpnext/accounts/doctype/bank/bank_dashboard.py
index e7ef6aa..36482aa 100644
--- a/erpnext/accounts/doctype/bank/bank_dashboard.py
+++ b/erpnext/accounts/doctype/bank/bank_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
index bc08eab..db4d7e5 100644
--- a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
+++ b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py
index c57e862..e786d13 100644
--- a/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py
+++ b/erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py
@@ -15,7 +15,6 @@
 from frappe.utils.xlsxutils import ILLEGAL_CHARACTERS_RE, handle_html
 from openpyxl.styles import Font
 from openpyxl.utils import get_column_letter
-from six import string_types
 
 
 class BankStatementImport(DataImport):
@@ -179,12 +178,12 @@
 	for row in data:
 		clean_row = []
 		for item in row:
-			if isinstance(item, string_types) and (sheet_name not in ['Data Import Template', 'Data Export']):
+			if isinstance(item, str) and (sheet_name not in ['Data Import Template', 'Data Export']):
 				value = handle_html(item)
 			else:
 				value = item
 
-			if isinstance(item, string_types) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None):
+			if isinstance(item, str) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None):
 				# Remove illegal characters from the string
 				value = re.sub(ILLEGAL_CHARACTERS_RE, '', value)
 
diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py b/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py
index 6125c27..cca8a88 100644
--- a/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py
+++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe.utils import getdate
 from frappe.utils.dateutils import parse_date
-from six import iteritems
 
 
 @frappe.whitelist()
@@ -43,7 +42,7 @@
 		if all(item is None for item in d) is True:
 			continue
 		fields = {}
-		for key, value in iteritems(header_map):
+		for key, value in header_map.items():
 			fields.update({key: d[int(value)-1]})
 
 		try:
diff --git a/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py b/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
index 4465ec6..6e7b687 100644
--- a/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
+++ b/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
@@ -1,4 +1,3 @@
-
 DEFAULT_MAPPERS = [
     {
         'doctype': 'Cash Flow Mapper',
diff --git a/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
index 0bae8fe..f524803 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
+++ b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/dunning/dunning.py b/erpnext/accounts/doctype/dunning/dunning.py
index 02377cd..5da0077 100644
--- a/erpnext/accounts/doctype/dunning/dunning.py
+++ b/erpnext/accounts/doctype/dunning/dunning.py
@@ -6,7 +6,6 @@
 
 import frappe
 from frappe.utils import cint, flt, getdate
-from six import string_types
 
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
 	get_accounting_dimensions,
@@ -108,7 +107,7 @@
 
 @frappe.whitelist()
 def get_dunning_letter_text(dunning_type, doc, language=None):
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 	if language:
 		filters = {'parent': dunning_type, 'language': language}
diff --git a/erpnext/accounts/doctype/dunning/dunning_dashboard.py b/erpnext/accounts/doctype/dunning/dunning_dashboard.py
index ebe4efb..a891bd2 100644
--- a/erpnext/accounts/doctype/dunning/dunning_dashboard.py
+++ b/erpnext/accounts/doctype/dunning/dunning_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py
index 0efe291..fe86250 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'reference_name',
diff --git a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py
index 4a56cd3..57b039d 100644
--- a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py
+++ b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py
index 3ede25f..892a2c6 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index f184b95..9d1452b 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -8,7 +8,6 @@
 from frappe.model.meta import get_field_precision
 from frappe.model.naming import set_name_from_naming_options
 from frappe.utils import flt, fmt_money
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -115,7 +114,7 @@
 
 	def validate_allowed_dimensions(self):
 		dimension_filter_map = get_dimension_filter_map()
-		for key, value in iteritems(dimension_filter_map):
+		for key, value in dimension_filter_map.items():
 			dimension = key[0]
 			account = key[1]
 
diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py
index 771846e..b748429 100644
--- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py
+++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py
index 71177c2..af01c57 100644
--- a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py
+++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 9c7e93f..ca17265 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _, msgprint, scrub
 from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, nowdate
-from six import iteritems, string_types
 
 import erpnext
 from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts
@@ -116,7 +115,7 @@
 				if d.reference_type in ("Sales Order", "Purchase Order", "Employee Advance"):
 					advance_paid.setdefault(d.reference_type, []).append(d.reference_name)
 
-		for voucher_type, order_list in iteritems(advance_paid):
+		for voucher_type, order_list in advance_paid.items():
 			for voucher_no in list(set(order_list)):
 				frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid()
 
@@ -431,7 +430,7 @@
 
 	def validate_orders(self):
 		"""Validate totals, closed and docstatus for orders"""
-		for reference_name, total in iteritems(self.reference_totals):
+		for reference_name, total in self.reference_totals.items():
 			reference_type = self.reference_types[reference_name]
 			account = self.reference_accounts[reference_name]
 
@@ -462,7 +461,7 @@
 
 	def validate_invoices(self):
 		"""Validate totals and docstatus for invoices"""
-		for reference_name, total in iteritems(self.reference_totals):
+		for reference_name, total in self.reference_totals.items():
 			reference_type = self.reference_types[reference_name]
 
 			if (reference_type in ("Sales Invoice", "Purchase Invoice") and
@@ -1007,7 +1006,7 @@
 	if not frappe.has_permission("Account"):
 		frappe.msgprint(_("No Permission"), raise_exception=1)
 
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	company_currency = erpnext.get_company_currency(args.get("company"))
diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py
index 7652e96..25328e5 100644
--- a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py
+++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'loyalty_program',
diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
index 3e6575f..96008c4 100644
--- a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
+++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index d6f594d..26fd16a 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import ValidationError, _, scrub, throw
 from frappe.utils import cint, comma_or, flt, getdate, nowdate
-from six import iteritems, string_types
 
 import erpnext
 from erpnext.accounts.doctype.bank_account.bank_account import (
@@ -203,7 +202,7 @@
 				ref_details = get_reference_details(d.reference_doctype,
 					d.reference_name, self.party_account_currency)
 
-				for field, value in iteritems(ref_details):
+				for field, value in ref_details.items():
 					if d.exchange_gain_loss:
 						# for cases where gain/loss is booked into invoice
 						# exchange_gain_loss is calculated from invoice & populated
@@ -387,7 +386,7 @@
 						invoice_paid_amount_map[invoice_key]['outstanding'] = term.outstanding
 						invoice_paid_amount_map[invoice_key]['discounted_amt'] = ref.total_amount * (term.discount / 100)
 
-		for idx, (key, allocated_amount) in enumerate(iteritems(invoice_payment_amount_map), 1):
+		for idx, (key, allocated_amount) in enumerate(invoice_payment_amount_map.items(), 1):
 			if not invoice_paid_amount_map.get(key):
 				frappe.throw(_('Payment term {0} not used in {1}').format(key[0], key[1]))
 
@@ -912,7 +911,7 @@
 		self.paid_amount_after_tax = self.paid_amount
 
 	def determine_exclusive_rate(self):
-		if not any((cint(tax.included_in_paid_amount) for tax in self.get("taxes"))):
+		if not any(cint(tax.included_in_paid_amount) for tax in self.get("taxes")):
 			return
 
 		cumulated_tax_fraction = 0
@@ -1032,7 +1031,7 @@
 @frappe.whitelist()
 def get_outstanding_reference_documents(args):
 
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	if args.get('party_type') == 'Member':
diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py
index bb0fc97..3996892 100644
--- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py
+++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'payment_gateway_account',
diff --git a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
index 02da979..37bbaec 100644
--- a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
+++ b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'payment_order',
diff --git a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py
index 7f5b96c..ac80b79 100644
--- a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py
+++ b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
index aa5de2c..2cf7a6c 100644
--- a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
index 814372f..0d6404c 100644
--- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
+++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate
-from six import iteritems
 
 from erpnext.accounts.doctype.loyalty_program.loyalty_program import validate_loyalty_points
 from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
@@ -364,7 +363,7 @@
 			for item in self.get("items"):
 				if item.get('item_code'):
 					profile_details = get_pos_profile_item_details(profile.get("company"), frappe._dict(item.as_dict()), profile)
-					for fname, val in iteritems(profile_details):
+					for fname, val in profile_details.items():
 						if (not for_validate) or (for_validate and not item.get(fname)):
 							item.set(fname, val)
 
@@ -524,9 +523,8 @@
 def make_merge_log(invoices):
 	import json
 
-	from six import string_types
 
-	if isinstance(invoices, string_types):
+	if isinstance(invoices, str):
 		invoices = json.loads(invoices)
 
 	if len(invoices) == 0:
diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
index 02a0b26..8434970 100644
--- a/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
+++ b/erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
@@ -5,7 +5,6 @@
 import json
 
 import frappe
-import six
 from frappe import _
 from frappe.core.page.background_jobs.background_jobs import get_info
 from frappe.model.document import Document
@@ -282,7 +281,7 @@
 
 def create_merge_logs(invoice_by_customer, closing_entry=None):
 	try:
-		for customer, invoices in six.iteritems(invoice_by_customer):
+		for customer, invoices in invoice_by_customer.items():
 			merge_log = frappe.new_doc('POS Invoice Merge Log')
 			merge_log.posting_date = getdate(closing_entry.get('posting_date')) if closing_entry else nowdate()
 			merge_log.customer = customer
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py
index d80c1b2..1d49c3d 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py
@@ -6,7 +6,6 @@
 from frappe import _, msgprint
 from frappe.model.document import Document
 from frappe.utils import get_link_to_form, now
-from six import iteritems
 
 
 class POSProfile(Document):
@@ -37,7 +36,7 @@
 			self.expense_account], "Cost Center": [self.cost_center],
 			"Warehouse": [self.warehouse]}
 
-		for link_dt, dn_list in iteritems(accounts):
+		for link_dt, dn_list in accounts.items():
 			for link_dn in dn_list:
 				if link_dn and not frappe.db.exists({"doctype": link_dt,
 						"company": self.company, "name": link_dn}):
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 23606ce..ac96b04 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -11,7 +11,6 @@
 from frappe import _, throw
 from frappe.model.document import Document
 from frappe.utils import cint, flt, getdate
-from six import string_types
 
 apply_on_dict = {"Item Code": "items",
 	"Item Group": "item_groups", "Brand": "brands"}
@@ -178,7 +177,7 @@
 		}
 	"""
 
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	args = frappe._dict(args)
@@ -234,7 +233,7 @@
 		get_product_discount_rule,
 	)
 
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 
 	if doc:
@@ -270,7 +269,7 @@
 		for pricing_rule in pricing_rules:
 			if not pricing_rule: continue
 
-			if isinstance(pricing_rule, string_types):
+			if isinstance(pricing_rule, str):
 				pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
 				pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule)
 
@@ -427,7 +426,7 @@
 
 @frappe.whitelist()
 def remove_pricing_rules(item_list):
-	if isinstance(item_list, string_types):
+	if isinstance(item_list, str):
 		item_list = json.loads(item_list)
 
 	out = []
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 984d65b..62e3dc8 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -6,7 +6,6 @@
 from frappe import _, throw
 from frappe.model.mapper import get_mapped_doc
 from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.deferred_revenue import validate_service_stop_date
@@ -600,7 +599,7 @@
 
 					# Amount added through landed-cost-voucher
 					if landed_cost_entries:
-						for account, amount in iteritems(landed_cost_entries[(item.item_code, item.name)]):
+						for account, amount in landed_cost_entries[(item.item_code, item.name)].items():
 							gl_entries.append(self.get_gl_dict({
 								"account": account,
 								"against": item.expense_account,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
index f1878b4..76c9fcd 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
index 95a7a1c..3176556 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index e77c4e1..cd270f5 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -18,7 +18,6 @@
 	getdate,
 	nowdate,
 )
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.deferred_revenue import validate_service_stop_date
@@ -533,7 +532,7 @@
 			for item in self.get("items"):
 				if item.get('item_code'):
 					profile_details = get_pos_profile_item_details(pos, frappe._dict(item.as_dict()), pos, update_data=True)
-					for fname, val in iteritems(profile_details):
+					for fname, val in profile_details.items():
 						if (not for_validate) or (for_validate and not item.get(fname)):
 							item.set(fname, val)
 
@@ -639,7 +638,7 @@
 			return
 
 		prev_doc_field_map = {'Sales Order': ['so_required', 'is_pos'],'Delivery Note': ['dn_required', 'update_stock']}
-		for key, value in iteritems(prev_doc_field_map):
+		for key, value in prev_doc_field_map.items():
 			if frappe.db.get_single_value('Selling Settings', value[0]) == 'Yes':
 
 				if frappe.get_value('Customer', self.customer, value[0]):
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
index 104d4f9..5cdc8da 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index e98ff3f..969756a 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -8,7 +8,6 @@
 from frappe.model.dynamic_links import get_dynamic_link_map
 from frappe.model.naming import make_autoname
 from frappe.utils import add_days, flt, getdate, nowdate
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
@@ -345,7 +344,7 @@
 
 		# check if item values are calculated
 		for i, d in enumerate(si.get("items")):
-			for k, v in iteritems(expected_values[i]):
+			for k, v in expected_values[i].items():
 				self.assertEqual(d.get(k), v)
 
 		# check net total
@@ -648,7 +647,7 @@
 
 		# check if item values are calculated
 		for i, d in enumerate(si.get("items")):
-			for key, val in iteritems(expected_values[i]):
+			for key, val in expected_values[i].items():
 				self.assertEqual(d.get(key), val)
 
 		# check net total
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
index 5b9fbaf..bc1fd8e 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/share_type/share_type_dashboard.py b/erpnext/accounts/doctype/share_type/share_type_dashboard.py
index fdb417e..d5551d1 100644
--- a/erpnext/accounts/doctype/share_type/share_type_dashboard.py
+++ b/erpnext/accounts/doctype/share_type/share_type_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py
index 44d5ec6..c01ac23 100644
--- a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py
+++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'shareholder',
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py
index ef2a053..fc70621 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index 68d9802..63b714e 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py
index 15df62d..d076e39 100644
--- a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py
index c9d52da..4bdb70a 100644
--- a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py
+++ b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index b0d6983..a16377c 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -10,7 +10,6 @@
 from frappe.model.document import Document
 from frappe.utils import cint, cstr
 from frappe.utils.nestedset import get_root_of
-from six import iteritems
 
 from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups
 
@@ -148,7 +147,7 @@
 	if 'tax_category' in args.keys():
 		del args['tax_category']
 
-	for key, value in iteritems(args):
+	for key, value in args.items():
 		if key=="use_for_shopping_cart":
 			conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
 		elif key == 'customer_group':
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 44344bb..d5ac9b2 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -11,7 +11,6 @@
 
 test_records = frappe.get_test_records('Tax Rule')
 
-from six import iteritems
 
 
 class TestTaxRule(unittest.TestCase):
@@ -175,7 +174,7 @@
 
 	tax_rule = frappe.new_doc("Tax Rule")
 
-	for key, val in iteritems(args):
+	for key, val in args.items():
 		if key != "save":
 			tax_rule.set(key, val)
 
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
index 31dcb40..dc1818a 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
@@ -378,7 +378,7 @@
 	current_invoice_total = get_invoice_total_without_tcs(inv, tax_details)
 	total_invoiced_amt = current_invoice_total + invoiced_amt + advance_amt - credit_note_amt
 
-	if ((cumulative_threshold and total_invoiced_amt >= cumulative_threshold)):
+	if (cumulative_threshold and total_invoiced_amt >= cumulative_threshold):
 		chargeable_amt = total_invoiced_amt - cumulative_threshold
 		tcs_amount = chargeable_amt * tax_details.rate / 100 if chargeable_amt > 0 else 0
 
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py
index 46d0c2e..256d4ac 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'tax_withholding_category',
diff --git a/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py b/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py
index 19b550f..02e3e93 100644
--- a/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py
+++ b/erpnext/accounts/notification/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 26ff2c6..2108bc1 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -26,7 +26,6 @@
 	getdate,
 	nowdate,
 )
-from six import iteritems
 
 import erpnext
 from erpnext import get_company_currency
@@ -508,7 +507,7 @@
 
 	timeline_items = dict(data)
 
-	for date, count in iteritems(timeline_items):
+	for date, count in timeline_items.items():
 		timestamp = get_timestamp(date)
 		out.update({ timestamp: count })
 
diff --git a/erpnext/accounts/report/account_balance/test_account_balance.py b/erpnext/accounts/report/account_balance/test_account_balance.py
index 50b1a67..73370e4 100644
--- a/erpnext/accounts/report/account_balance/test_account_balance.py
+++ b/erpnext/accounts/report/account_balance/test_account_balance.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
index b5408bd..ab95c93 100644
--- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index a95bcf8..3c94629 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _, scrub
 from frappe.utils import cint
-from six import iteritems
 
 from erpnext.accounts.party import get_partywise_advanced_payment_amount
 from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
@@ -37,7 +36,7 @@
 		party_advance_amount = get_partywise_advanced_payment_amount(self.party_type,
 			self.filters.report_date, self.filters.show_future_payments, self.filters.company) or {}
 
-		for party, party_dict in iteritems(self.party_total):
+		for party, party_dict in self.party_total.items():
 			if party_dict.outstanding == 0:
 				continue
 
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
index ead6776..3bb590a 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt, formatdate
-from six import iteritems
 
 from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges
 
@@ -48,7 +47,7 @@
 	return columns, data, None, chart
 
 def get_final_data(dimension, dimension_items, filters, period_month_ranges, data, DCC_allocation):
-	for account, monthwise_data in iteritems(dimension_items):
+	for account, monthwise_data in dimension_items.items():
 		row = [dimension, account]
 		totals = [0, 0, 0]
 		for year in get_fiscal_years(filters):
diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py
index 75365b8..15041f2 100644
--- a/erpnext/accounts/report/cash_flow/cash_flow.py
+++ b/erpnext/accounts/report/cash_flow/cash_flow.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cint, cstr
-from six import iteritems
 
 from erpnext.accounts.report.financial_statements import (
 	get_columns,
@@ -201,7 +200,7 @@
 def get_report_summary(summary_data, currency):
 	report_summary = []
 
-	for label, value in iteritems(summary_data):
+	for label, value in summary_data.items():
 		report_summary.append(
 			{
 				"value": value,
diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
index 2954619..56db841 100644
--- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
+++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _, scrub
 from frappe.utils import getdate, nowdate
-from six import iteritems, itervalues
 
 
 class PartyLedgerSummaryReport(object):
@@ -143,9 +142,9 @@
 					self.party_data[gle.party].paid_amount -= amount
 
 		out = []
-		for party, row in iteritems(self.party_data):
+		for party, row in self.party_data.items():
 			if row.opening_balance or row.invoiced_amount or row.paid_amount or row.return_amount or row.closing_amount:
-				total_party_adjustment = sum(amount for amount in itervalues(self.party_adjustment_details.get(party, {})))
+				total_party_adjustment = sum(amount for amount in self.party_adjustment_details.get(party, {}).values())
 				row.paid_amount -= total_party_adjustment
 
 				adjustments = self.party_adjustment_details.get(party, {})
@@ -267,7 +266,7 @@
 			adjustment_voucher_entries.setdefault((gle.voucher_type, gle.voucher_no), [])
 			adjustment_voucher_entries[(gle.voucher_type, gle.voucher_no)].append(gle)
 
-		for voucher_gl_entries in itervalues(adjustment_voucher_entries):
+		for voucher_gl_entries in adjustment_voucher_entries.values():
 			parties = {}
 			accounts = {}
 			has_irrelevant_entry = False
@@ -287,7 +286,7 @@
 			if parties and accounts:
 				if len(parties) == 1:
 					party = list(parties.keys())[0]
-					for account, amount in iteritems(accounts):
+					for account, amount in accounts.items():
 						self.party_adjustment_accounts.add(account)
 						self.party_adjustment_details.setdefault(party, {})
 						self.party_adjustment_details[party].setdefault(account, 0)
@@ -295,7 +294,7 @@
 				elif len(accounts) == 1 and not has_irrelevant_entry:
 					account = list(accounts.keys())[0]
 					self.party_adjustment_accounts.add(account)
-					for party, amount in iteritems(parties):
+					for party, amount in parties.items():
 						self.party_adjustment_details.setdefault(party, {})
 						self.party_adjustment_details[party].setdefault(account, 0)
 						self.party_adjustment_details[party][account] += amount
diff --git a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py
index c69bb3f..d547470 100644
--- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py
+++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cstr, flt
-from six import itervalues
 
 import erpnext
 from erpnext.accounts.report.financial_statements import (
@@ -107,7 +106,7 @@
 
 def format_gl_entries(gl_entries_by_account, accounts_by_name, dimension_items_list):
 
-	for entries in itervalues(gl_entries_by_account):
+	for entries in gl_entries_by_account.values():
 		for entry in entries:
 			d = accounts_by_name.get(entry.account)
 			if not d:
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 37ff103..4bb44b3 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
@@ -10,7 +9,6 @@
 import frappe
 from frappe import _
 from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate
-from six import itervalues
 
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
 	get_accounting_dimensions,
@@ -188,7 +186,7 @@
 
 def calculate_values(
 		accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy):
-	for entries in itervalues(gl_entries_by_account):
+	for entries in gl_entries_by_account.values():
 		for entry in entries:
 			d = accounts_by_name.get(entry.account)
 			if not d:
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index f538764..050403d 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _, _dict
 from frappe.utils import cstr, flt, getdate
-from six import iteritems
 
 from erpnext import get_company_currency, get_default_company
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -314,7 +313,7 @@
 	data.append(totals.opening)
 
 	if filters.get("group_by") != 'Group by Voucher (Consolidated)':
-		for acc, acc_dict in iteritems(gle_map):
+		for acc, acc_dict in gle_map.items():
 			# acc
 			if acc_dict.entries:
 				# opening
diff --git a/erpnext/accounts/report/tax_detail/test_tax_detail.py b/erpnext/accounts/report/tax_detail/test_tax_detail.py
index 7292f2b..bf668ab 100644
--- a/erpnext/accounts/report/tax_detail/test_tax_detail.py
+++ b/erpnext/accounts/report/tax_detail/test_tax_detail.py
@@ -1,4 +1,3 @@
-
 import datetime
 import json
 import os
diff --git a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
index d576c27..07f2e43 100644
--- a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
+++ b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py
index 89cc0a8..c38e4b8 100644
--- a/erpnext/accounts/report/utils.py
+++ b/erpnext/accounts/report/utils.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import flt, formatdate, get_datetime_str
 
diff --git a/erpnext/accounts/test/test_utils.py b/erpnext/accounts/test/test_utils.py
index 4aca40c..effc913 100644
--- a/erpnext/accounts/test/test_utils.py
+++ b/erpnext/accounts/test/test_utils.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 from frappe.test_runner import make_test_objects
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 4340840..39e84e3 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -9,7 +9,6 @@
 from frappe import _, throw
 from frappe.model.meta import get_field_precision
 from frappe.utils import cint, cstr, flt, formatdate, get_number_format_info, getdate, now, nowdate
-from six import string_types
 
 import erpnext
 
@@ -795,7 +794,7 @@
 @frappe.whitelist()
 def get_account_balances(accounts, company):
 
-	if isinstance(accounts, string_types):
+	if isinstance(accounts, str):
 		accounts = loads(accounts)
 
 	if not accounts:
diff --git a/erpnext/agriculture/doctype/crop/crop_dashboard.py b/erpnext/agriculture/doctype/crop/crop_dashboard.py
index 772ed61..37cdbb2 100644
--- a/erpnext/agriculture/doctype/crop/crop_dashboard.py
+++ b/erpnext/agriculture/doctype/crop/crop_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py
index cfe7edc..c0c437f 100644
--- a/erpnext/assets/doctype/asset/asset.py
+++ b/erpnext/assets/doctype/asset/asset.py
@@ -20,7 +20,6 @@
 	nowdate,
 	today,
 )
-from six import string_types
 
 import erpnext
 from erpnext.accounts.general_ledger import make_reverse_gl_entries
@@ -625,7 +624,7 @@
 
 	@frappe.whitelist()
 	def get_depreciation_rate(self, args, on_validate=False):
-		if isinstance(args, string_types):
+		if isinstance(args, str):
 			args = json.loads(args)
 
 		float_precision = cint(frappe.db.get_default("float_precision")) or 2
@@ -820,9 +819,7 @@
 def make_asset_movement(assets, purpose=None):
 	import json
 
-	from six import string_types
-
-	if isinstance(assets, string_types):
+	if isinstance(assets, str):
 		assets = json.loads(assets)
 
 	if len(assets) == 0:
diff --git a/erpnext/assets/doctype/asset/asset_dashboard.py b/erpnext/assets/doctype/asset/asset_dashboard.py
index c9efe3d..00d0847 100644
--- a/erpnext/assets/doctype/asset/asset_dashboard.py
+++ b/erpnext/assets/doctype/asset/asset_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'non_standard_fieldnames': {
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
index 8588c00..0163595 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
index b670bd5..2db750e 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -12,7 +12,6 @@
 from frappe.utils import get_url
 from frappe.utils.print_format import download_pdf
 from frappe.utils.user import get_user_fullname
-from six import string_types
 
 from erpnext.accounts.party import get_party_account_currency, get_party_details
 from erpnext.buying.utils import validate_for_items
@@ -288,7 +287,7 @@
 # This method is used to make supplier quotation from supplier's portal.
 @frappe.whitelist()
 def create_supplier_quotation(doc):
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 
 	try:
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
index 21ef332..dc1cda1 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'docstatus': 1,
diff --git a/erpnext/buying/doctype/supplier/supplier_dashboard.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py
index cfa0375..78efd8e 100644
--- a/erpnext/buying/doctype/supplier/supplier_dashboard.py
+++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
index 1680efc..236b91a 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
index e021c9c..5d69326 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/config/education.py b/erpnext/config/education.py
index 3ead3ef..d718a94 100644
--- a/erpnext/config/education.py
+++ b/erpnext/config/education.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/config/projects.py b/erpnext/config/projects.py
index 168dead..f4675e7 100644
--- a/erpnext/config/projects.py
+++ b/erpnext/config/projects.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 1b85871..e0551a4 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -20,7 +20,6 @@
 	nowdate,
 	today,
 )
-from six import text_type
 
 import erpnext
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -1080,7 +1079,7 @@
 			stock_items = [r[0] for r in frappe.db.sql("""
 				select name from `tabItem`
 				where name in (%s) and is_stock_item=1
-			""" % (", ".join((["%s"] * len(item_codes))),), item_codes)]
+			""" % (", ".join(["%s"] * len(item_codes)),), item_codes)]
 
 		return stock_items
 
@@ -1789,7 +1788,7 @@
 @frappe.whitelist()
 def get_payment_term_details(term, posting_date=None, grand_total=None, base_grand_total=None, bill_date=None):
 	term_details = frappe._dict()
-	if isinstance(term, text_type):
+	if isinstance(term, str):
 		term = frappe.get_doc("Payment Term", term)
 	else:
 		term_details.payment_term = term.payment_term
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index 2d65108..2bad6f8 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -8,7 +8,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cstr, flt
-from six import string_types
 
 
 class ItemVariantExistsError(frappe.ValidationError): pass
@@ -30,7 +29,7 @@
 		return make_variant_based_on_manufacturer(item_template, manufacturer,
 			manufacturer_part_no)
 	else:
-		if isinstance(args, string_types):
+		if isinstance(args, str):
 			args = json.loads(args)
 
 		if not args:
@@ -54,7 +53,7 @@
 	return variant
 
 def validate_item_variant_attributes(item, args=None):
-	if isinstance(item, string_types):
+	if isinstance(item, str):
 		item = frappe.get_doc('Item', item)
 
 	if not args:
@@ -156,7 +155,7 @@
 
 @frappe.whitelist()
 def create_variant(item, args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	template = frappe.get_doc("Item", item)
@@ -179,7 +178,7 @@
 @frappe.whitelist()
 def enqueue_multiple_variant_creation(item, args):
 	# There can be innumerable attribute combinations, enqueue
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		variants = json.loads(args)
 	total_variants = 1
 	for key in variants:
@@ -196,7 +195,7 @@
 
 def create_multiple_variants(item, args):
 	count = 0
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	args_set = generate_keyed_value_combinations(args)
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index aac72ab..667edab 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -176,7 +176,7 @@
 			self.doc.round_floats_in(tax)
 
 	def determine_exclusive_rate(self):
-		if not any((cint(tax.included_in_print_rate) for tax in self.doc.get("taxes"))):
+		if not any(cint(tax.included_in_print_rate) for tax in self.doc.get("taxes")):
 			return
 
 		for item in self.doc.get("items"):
diff --git a/erpnext/controllers/tests/test_item_variant.py b/erpnext/controllers/tests/test_item_variant.py
index 391b5ec..5c6e06a 100644
--- a/erpnext/controllers/tests/test_item_variant.py
+++ b/erpnext/controllers/tests/test_item_variant.py
@@ -1,9 +1,7 @@
-
 import json
 import unittest
 
 import frappe
-from six import string_types
 
 from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code
 from erpnext.stock.doctype.item.test_item import set_item_variant_settings
@@ -20,7 +18,7 @@
 		self.assertEqual(variant.get("quality_inspection_template"), "_Test QC Template")
 
 def create_variant_with_tables(item, args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	qc_name = make_quality_inspection_template()
diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py
index 0d8789a..e755876 100644
--- a/erpnext/controllers/tests/test_mapper.py
+++ b/erpnext/controllers/tests/test_mapper.py
@@ -1,4 +1,3 @@
-
 import json
 import unittest
 
diff --git a/erpnext/controllers/tests/test_qty_based_taxes.py b/erpnext/controllers/tests/test_qty_based_taxes.py
index 226778d..49b844b 100644
--- a/erpnext/controllers/tests/test_qty_based_taxes.py
+++ b/erpnext/controllers/tests/test_qty_based_taxes.py
@@ -1,4 +1,3 @@
-
 import unittest
 from uuid import uuid4 as _uuid4
 
diff --git a/erpnext/crm/doctype/contract_template/contract_template.py b/erpnext/crm/doctype/contract_template/contract_template.py
index 8adbb4e..7439e4c 100644
--- a/erpnext/crm/doctype/contract_template/contract_template.py
+++ b/erpnext/crm/doctype/contract_template/contract_template.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe.model.document import Document
 from frappe.utils.jinja import validate_template
-from six import string_types
 
 
 class ContractTemplate(Document):
@@ -17,7 +16,7 @@
 
 @frappe.whitelist()
 def get_contract_template(template_name, doc):
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 
 	contract_template = frappe.get_doc("Contract Template", template_name)
diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py
index 37e28e0..017390d 100644
--- a/erpnext/crm/doctype/lead/lead_dashboard.py
+++ b/erpnext/crm/doctype/lead/lead_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'lead',
diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
index 5d42482..708fb12 100644
--- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
+++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'opportunity',
diff --git a/erpnext/crm/doctype/utils.py b/erpnext/crm/doctype/utils.py
index 0da0e0e..9b56170 100644
--- a/erpnext/crm/doctype/utils.py
+++ b/erpnext/crm/doctype/utils.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.py b/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.py
index 4cff13f..f53b5bd 100644
--- a/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.py
+++ b/erpnext/crm/report/opportunity_summary_by_sales_stage/opportunity_summary_by_sales_stage.py
@@ -6,7 +6,6 @@
 import pandas
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 from erpnext.setup.utils import get_exchange_rate
 
@@ -126,7 +125,7 @@
 		self.data = []
 		self.get_formatted_data()
 
-		for based_on,data in iteritems(self.formatted_data):
+		for based_on,data in self.formatted_data.items():
 			row_based_on={
 				'Opportunity Owner': 'opportunity_owner',
 				'Source': 'source',
@@ -251,4 +250,4 @@
 			if data.get('currency') != default_currency:
 				opportunity_currency = data.get('currency')
 				value = self.currency_conversion(opportunity_currency,default_currency)
-				data['amount'] = data['amount'] * value
\ No newline at end of file
+				data['amount'] = data['amount'] * value
diff --git a/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.py b/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.py
index 7466982..1c7846b 100644
--- a/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.py
+++ b/erpnext/crm/report/sales_pipeline_analytics/sales_pipeline_analytics.py
@@ -9,7 +9,6 @@
 from dateutil.relativedelta import relativedelta
 from frappe import _
 from frappe.utils import cint, flt
-from six import iteritems
 
 from erpnext.setup.utils import get_exchange_rate
 
@@ -295,7 +294,7 @@
 
 	def append_data(self, pipeline_by, period_by):
 		self.data = []
-		for pipeline,period_data in iteritems(self.periodic_data):
+		for pipeline,period_data in self.periodic_data.items():
 			row = {pipeline_by : pipeline}
 			for info in self.query_result:
 				if self.filters.get('range') == 'Monthly':
@@ -330,4 +329,4 @@
 			if data.get('currency') != default_currency:
 				opportunity_currency = data.get('currency')
 				value = self.get_currency_rate(opportunity_currency,default_currency)
-				data['amount'] = data['amount'] * value
\ No newline at end of file
+				data['amount'] = data['amount'] * value
diff --git a/erpnext/demo/demo.py b/erpnext/demo/demo.py
index e1bf8d0..4a18a99 100644
--- a/erpnext/demo/demo.py
+++ b/erpnext/demo/demo.py
@@ -1,4 +1,3 @@
-
 import sys
 
 import frappe
diff --git a/erpnext/demo/domains.py b/erpnext/demo/domains.py
index 89bd9ab..5fa181d 100644
--- a/erpnext/demo/domains.py
+++ b/erpnext/demo/domains.py
@@ -1,4 +1,3 @@
-
 data = {
 	'Manufacturing': {
 		'company_name': 'Wind Power LLC'
diff --git a/erpnext/demo/setup/manufacture.py b/erpnext/demo/setup/manufacture.py
index ec6d281..fe1a1fb 100644
--- a/erpnext/demo/setup/manufacture.py
+++ b/erpnext/demo/setup/manufacture.py
@@ -1,10 +1,8 @@
-
 import json
 import random
 
 import frappe
 from frappe.utils import add_days, nowdate
-from six import iteritems
 
 from erpnext.demo.domains import data
 from erpnext.demo.setup.setup_data import import_json
@@ -130,7 +128,7 @@
 	}
 
 	for price_list in ("standard_buying", "standard_selling"):
-		for item, rate in iteritems(locals().get(price_list)):
+		for item, rate in locals().get(price_list).items():
 			frappe.get_doc({
 				"doctype": "Item Price",
 				"price_list": price_list.replace("_", " ").title(),
diff --git a/erpnext/demo/setup/retail.py b/erpnext/demo/setup/retail.py
index 3d2c8b6..0469264 100644
--- a/erpnext/demo/setup/retail.py
+++ b/erpnext/demo/setup/retail.py
@@ -1,8 +1,6 @@
-
 import json
 
 import frappe
-from six import iteritems
 
 from erpnext.demo.domains import data
 
@@ -52,7 +50,7 @@
 	}
 
 	for price_list in ("standard_buying", "standard_selling"):
-		for item, rate in iteritems(locals().get(price_list)):
+		for item, rate in locals().get(price_list).items():
 			frappe.get_doc({
 				"doctype": "Item Price",
 				"price_list": price_list.replace("_", " ").title(),
diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py
index 1ce995a..7137c6e 100644
--- a/erpnext/demo/setup/setup_data.py
+++ b/erpnext/demo/setup/setup_data.py
@@ -1,4 +1,3 @@
-
 import json
 import random
 
diff --git a/erpnext/demo/user/accounts.py b/erpnext/demo/user/accounts.py
index f0ac173..273a3f9 100644
--- a/erpnext/demo/user/accounts.py
+++ b/erpnext/demo/user/accounts.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/demo/user/education.py b/erpnext/demo/user/education.py
index 270333c..47519c1 100644
--- a/erpnext/demo/user/education.py
+++ b/erpnext/demo/user/education.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/demo/user/fixed_asset.py b/erpnext/demo/user/fixed_asset.py
index 0e66ec0..72cd420 100644
--- a/erpnext/demo/user/fixed_asset.py
+++ b/erpnext/demo/user/fixed_asset.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/demo/user/hr.py b/erpnext/demo/user/hr.py
index 3d1a013..f84a853 100644
--- a/erpnext/demo/user/hr.py
+++ b/erpnext/demo/user/hr.py
@@ -1,4 +1,3 @@
-
 import datetime
 import random
 
diff --git a/erpnext/domains/agriculture.py b/erpnext/domains/agriculture.py
index de27a7a..e5414a9 100644
--- a/erpnext/domains/agriculture.py
+++ b/erpnext/domains/agriculture.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Agriculture Task',
diff --git a/erpnext/domains/distribution.py b/erpnext/domains/distribution.py
index 68ac0c3..020ab3b 100644
--- a/erpnext/domains/distribution.py
+++ b/erpnext/domains/distribution.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Item',
diff --git a/erpnext/domains/education.py b/erpnext/domains/education.py
index d0e597e..11ea9b4 100644
--- a/erpnext/domains/education.py
+++ b/erpnext/domains/education.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Student',
diff --git a/erpnext/domains/hospitality.py b/erpnext/domains/hospitality.py
index 5d2a225..09b98c2 100644
--- a/erpnext/domains/hospitality.py
+++ b/erpnext/domains/hospitality.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Restaurant',
diff --git a/erpnext/domains/manufacturing.py b/erpnext/domains/manufacturing.py
index 0cd51cf..96ce194 100644
--- a/erpnext/domains/manufacturing.py
+++ b/erpnext/domains/manufacturing.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Item',
diff --git a/erpnext/domains/non_profit.py b/erpnext/domains/non_profit.py
index 22f05c9..d9fc5e5 100644
--- a/erpnext/domains/non_profit.py
+++ b/erpnext/domains/non_profit.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Non Profit',
diff --git a/erpnext/domains/retail.py b/erpnext/domains/retail.py
index 17578d7..07b2e27 100644
--- a/erpnext/domains/retail.py
+++ b/erpnext/domains/retail.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'POS',
diff --git a/erpnext/domains/services.py b/erpnext/domains/services.py
index 39a554f..6035afb 100644
--- a/erpnext/domains/services.py
+++ b/erpnext/domains/services.py
@@ -1,4 +1,3 @@
-
 data = {
 	'desktop_icons': [
 		'Project',
diff --git a/erpnext/education/__init__.py b/erpnext/education/__init__.py
index cf8efde..56c2b29 100644
--- a/erpnext/education/__init__.py
+++ b/erpnext/education/__init__.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/education/doctype/academic_term/academic_term_dashboard.py b/erpnext/education/doctype/academic_term/academic_term_dashboard.py
index 97f581a..c686b09 100644
--- a/erpnext/education/doctype/academic_term/academic_term_dashboard.py
+++ b/erpnext/education/doctype/academic_term/academic_term_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/academic_year/academic_year_dashboard.py b/erpnext/education/doctype/academic_year/academic_year_dashboard.py
index 3615fd1..ede2411 100644
--- a/erpnext/education/doctype/academic_year/academic_year_dashboard.py
+++ b/erpnext/education/doctype/academic_year/academic_year_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/course_schedule/course_schedule.py b/erpnext/education/doctype/course_schedule/course_schedule.py
index 335b6d2..ffd323d 100644
--- a/erpnext/education/doctype/course_schedule/course_schedule.py
+++ b/erpnext/education/doctype/course_schedule/course_schedule.py
@@ -1,4 +1,4 @@
-	# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
 # Copyright (c) 2015, Frappe Technologies and contributors
 # For license information, please see license.txt
 
diff --git a/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py b/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py
index 44313f2..b8ae8b0 100644
--- a/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py
+++ b/erpnext/education/doctype/grading_scale/grading_scale_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py b/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py
index 81bb30b..14ed95d 100644
--- a/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/student/student_dashboard.py b/erpnext/education/doctype/student/student_dashboard.py
index efd5dc9..3ae772d 100644
--- a/erpnext/education/doctype/student/student_dashboard.py
+++ b/erpnext/education/doctype/student/student_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/student_applicant/student_applicant.py b/erpnext/education/doctype/student_applicant/student_applicant.py
index 62407be..5dae9f6 100644
--- a/erpnext/education/doctype/student_applicant/student_applicant.py
+++ b/erpnext/education/doctype/student_applicant/student_applicant.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-777777yyy
 # Copyright (c) 2015, Frappe Technologies and contributors
 # For license information, please see license.txt
 
diff --git a/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py b/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py
index 9754799..6758452 100644
--- a/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py
+++ b/erpnext/education/doctype/student_attendance/student_attendance_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/student_category/student_category_dashboard.py b/erpnext/education/doctype/student_category/student_category_dashboard.py
index be1e005..ebb639e 100644
--- a/erpnext/education/doctype/student_category/student_category_dashboard.py
+++ b/erpnext/education/doctype/student_category/student_category_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py b/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py
index fca5ad6..d01790d 100644
--- a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py
+++ b/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'leave_application',
diff --git a/erpnext/education/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py
index 19b550f..02e3e93 100644
--- a/erpnext/education/web_form/student_applicant/student_applicant.py
+++ b/erpnext/education/web_form/student_applicant/student_applicant.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
index fdeb32d..f5f9ce3 100644
--- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
+++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
@@ -1,5 +1,3 @@
-
-
 import base64
 import hashlib
 import hmac
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
index d7ebf59..1d0dfa5 100644
--- a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
+++ b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
index 7dd0c86..212f81b 100644
--- a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
+++ b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
@@ -1,5 +1,3 @@
-
-
 def pre_process(milestone):
 	return {
 		'title': milestone.title,
diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
index 7feca83..66826ba 100644
--- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
+++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py
@@ -30,7 +30,7 @@
 
 			#Get ASIN Codes
 			string_io = StringIO(frappe.safe_decode(listings_response.original))
-			csv_rows = list(csv.reader(string_io, delimiter=str('\t')))
+			csv_rows = list(csv.reader(string_io, delimiter='\t'))
 			asin_list = list(set([row[1] for row in csv_rows[1:]]))
 			#break into chunks of 10
 			asin_chunked_list = list(chunks(asin_list, 10))
diff --git a/erpnext/erpnext_integrations/utils.py b/erpnext/erpnext_integrations/utils.py
index 57c4367..b52c3fc 100644
--- a/erpnext/erpnext_integrations/utils.py
+++ b/erpnext/erpnext_integrations/utils.py
@@ -1,4 +1,3 @@
-
 import base64
 import hashlib
 import hmac
diff --git a/erpnext/exceptions.py b/erpnext/exceptions.py
index cfd2a7c..8d6f13a 100644
--- a/erpnext/exceptions.py
+++ b/erpnext/exceptions.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index bc8ef82..2a277ee 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 app_name = "erpnext"
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py
index f52e2b0..116a3f9 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'kra_template',
diff --git a/erpnext/hr/doctype/attendance/attendance_dashboard.py b/erpnext/hr/doctype/attendance/attendance_dashboard.py
index f466534..4bb36a0 100644
--- a/erpnext/hr/doctype/attendance/attendance_dashboard.py
+++ b/erpnext/hr/doctype/attendance/attendance_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'attendance',
diff --git a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
index b23e0fd..9197057 100644
--- a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
+++ b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname':  'attendance_request',
diff --git a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py
index 38e1f54..fe11c47 100644
--- a/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py
+++ b/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py
@@ -7,7 +7,6 @@
 from frappe import _
 from frappe.model.document import Document
 from frappe.utils import global_date_format
-from six import string_types
 
 
 class DailyWorkSummary(Document):
@@ -107,7 +106,7 @@
 
 	:param group: Daily Work Summary Group `name`'''
 	group_doc = group
-	if isinstance(group_doc, string_types):
+	if isinstance(group_doc, str):
 		group_doc = frappe.get_doc('Daily Work Summary Group', group)
 
 	emails = get_users_email(group_doc)
diff --git a/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py b/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py
index 306f43a..ed98168 100644
--- a/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py
+++ b/erpnext/hr/doctype/daily_work_summary_group/daily_work_summary_group.py
@@ -1,4 +1,3 @@
-# # -*- coding: utf-8 -*-
 # # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
 # # For license information, please see license.txt
 
diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py
index 0aaff52..a4c0af0 100644
--- a/erpnext/hr/doctype/employee/employee_dashboard.py
+++ b/erpnext/hr/doctype/employee/employee_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py
index 089bd2c..9450258 100644
--- a/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py
+++ b/erpnext/hr/doctype/employee_advance/employee_advance_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'employee_advance',
diff --git a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
index 1dd6ad3..6825dae 100644
--- a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
+++ b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'transactions': [
diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py
index 48f2c1d..3b846a0 100644
--- a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py
+++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'employee_onboarding_template',
diff --git a/erpnext/hr/doctype/employee_referral/employee_referral.py b/erpnext/hr/doctype/employee_referral/employee_referral.py
index 4e1780b..eaa42c7 100644
--- a/erpnext/hr/doctype/employee_referral/employee_referral.py
+++ b/erpnext/hr/doctype/employee_referral/employee_referral.py
@@ -60,9 +60,8 @@
 def create_additional_salary(doc):
 	import json
 
-	from six import string_types
 
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = frappe._dict(json.loads(doc))
 
 	if not frappe.db.exists("Additional Salary", {"ref_docname": doc.name}):
diff --git a/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py b/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py
index 1733ac9..07c2402 100644
--- a/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py
+++ b/erpnext/hr/doctype/employee_referral/employee_referral_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'employee_referral',
diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py
index f165d0a..6e2a83e 100644
--- a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py
+++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'employee_separation_template',
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py b/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py
index 44052cc..7539c71 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py
+++ b/erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
index e074e26..4a540ce 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
+++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'holiday_list',
diff --git a/erpnext/hr/doctype/interview/interview.py b/erpnext/hr/doctype/interview/interview.py
index f531247..4bb003d 100644
--- a/erpnext/hr/doctype/interview/interview.py
+++ b/erpnext/hr/doctype/interview/interview.py
@@ -190,9 +190,8 @@
 def create_interview_feedback(data, interview_name, interviewer, job_applicant):
 	import json
 
-	from six import string_types
 
-	if isinstance(data, string_types):
+	if isinstance(data, str):
 		data = frappe._dict(json.loads(data))
 
 	if frappe.session.user != interviewer:
@@ -288,4 +287,4 @@
 
 		events.append(interview_data)
 
-	return events
\ No newline at end of file
+	return events
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py
index f0b470b..abaa50c 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.py
@@ -48,9 +48,8 @@
 def create_interview(doc, interview_round):
 	import json
 
-	from six import string_types
 
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 		doc = frappe.get_doc(doc)
 
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py
index 9406fc5..56331ac 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'job_applicant',
diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py
index 8179690..67600dc 100644
--- a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py
+++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'job_title',
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py
index 08861b8..631beef 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'leave_allocation',
diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py
index f6165b3..46401a2 100644
--- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py
+++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/hr/doctype/leave_application/leave_application_dashboard.py b/erpnext/hr/doctype/leave_application/leave_application_dashboard.py
index d56133b..8b0b98d 100644
--- a/erpnext/hr/doctype/leave_application/leave_application_dashboard.py
+++ b/erpnext/hr/doctype/leave_application/leave_application_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
index f91a8fe..7cca62e 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname':  'leave_block_list',
diff --git a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
index fbe56e2..1adae0f 100644
--- a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
+++ b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
index 8311fd2..73782d6 100644
--- a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
+++ b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py
index 2ffec79..dca7e48 100644
--- a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py
+++ b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment.py
@@ -9,7 +9,6 @@
 from frappe import _, bold
 from frappe.model.document import Document
 from frappe.utils import date_diff, flt, formatdate, get_datetime, getdate
-from six import string_types
 
 
 class LeavePolicyAssignment(Document):
@@ -138,10 +137,10 @@
 @frappe.whitelist()
 def create_assignment_for_multiple_employees(employees, data):
 
-	if isinstance(employees, string_types):
+	if isinstance(employees, str):
 		employees= json.loads(employees)
 
-	if isinstance(data, string_types):
+	if isinstance(data, str):
 		data = frappe._dict(json.loads(data))
 
 	docs_name = []
diff --git a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py
index ec6592c..4363439 100644
--- a/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py
+++ b/erpnext/hr/doctype/leave_policy_assignment/leave_policy_assignment_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
index 8dc9402..074d3e4 100644
--- a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
+++ b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'leave_type',
diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py
index cd4519e..531c98d 100644
--- a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py
+++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'shift_request',
diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py
index b523f0e..919da2d 100644
--- a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py
+++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'shift',
diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py
index c04e585..abde0d5 100644
--- a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py
+++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'staffing_plan',
diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py
index 8c4162d..141fffc 100644
--- a/erpnext/hr/doctype/training_event/training_event_dashboard.py
+++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'training_event',
diff --git a/erpnext/hr/doctype/training_program/training_program_dashboard.py b/erpnext/hr/doctype/training_program/training_program_dashboard.py
index 51137d1..374c1e8 100644
--- a/erpnext/hr/doctype/training_program/training_program_dashboard.py
+++ b/erpnext/hr/doctype/training_program/training_program_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
index bb38ab9..f6e5f06 100644
--- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
+++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/hr/notification/training_feedback/training_feedback.py b/erpnext/hr/notification/training_feedback/training_feedback.py
index 19b550f..02e3e93 100644
--- a/erpnext/hr/notification/training_feedback/training_feedback.py
+++ b/erpnext/hr/notification/training_feedback/training_feedback.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/hr/notification/training_scheduled/training_scheduled.py b/erpnext/hr/notification/training_scheduled/training_scheduled.py
index 19b550f..02e3e93 100644
--- a/erpnext/hr/notification/training_scheduled/training_scheduled.py
+++ b/erpnext/hr/notification/training_scheduled/training_scheduled.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/hr/page/organizational_chart/organizational_chart.py b/erpnext/hr/page/organizational_chart/organizational_chart.py
index 01d95a7..1e2d758 100644
--- a/erpnext/hr/page/organizational_chart/organizational_chart.py
+++ b/erpnext/hr/page/organizational_chart/organizational_chart.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/hr/page/team_updates/team_updates.py b/erpnext/hr/page/team_updates/team_updates.py
index 126ed89..0a4624c 100644
--- a/erpnext/hr/page/team_updates/team_updates.py
+++ b/erpnext/hr/page/team_updates/team_updates.py
@@ -1,4 +1,3 @@
-
 import frappe
 from email_reply_parser import EmailReplyParser
 
diff --git a/erpnext/hr/web_form/job_application/job_application.py b/erpnext/hr/web_form/job_application/job_application.py
index 19b550f..02e3e93 100644
--- a/erpnext/hr/web_form/job_application/job_application.py
+++ b/erpnext/hr/web_form/job_application/job_application.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py b/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py
index 9512c8f..6144d9d 100644
--- a/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py
+++ b/erpnext/loan_management/dashboard_chart_source/top_10_pledged_loan_securities/top_10_pledged_loan_securities.py
@@ -4,7 +4,6 @@
 
 import frappe
 from frappe.utils.dashboard import cache_source
-from six import iteritems
 
 from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure import (
 	get_loan_security_details,
@@ -53,14 +52,14 @@
 		GROUP BY p.loan_security
 	""".format(conditions=conditions), filters, as_list=1))
 
-	for security, qty in iteritems(pledges):
+	for security, qty in pledges.items():
 		current_pledges.setdefault(security, qty)
 		current_pledges[security] -= unpledges.get(security, 0.0)
 
 	sorted_pledges = dict(sorted(current_pledges.items(), key=lambda item: item[1], reverse=True))
 
 	count = 0
-	for security, qty in iteritems(sorted_pledges):
+	for security, qty in sorted_pledges.items():
 		values.append(qty * loan_security_details.get(security, {}).get('latest_price', 0))
 		labels.append(security)
 		count +=1
diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py
index 423807a..84e0f03 100644
--- a/erpnext/loan_management/doctype/loan/loan.py
+++ b/erpnext/loan_management/doctype/loan/loan.py
@@ -8,7 +8,6 @@
 import frappe
 from frappe import _
 from frappe.utils import add_months, flt, getdate, now_datetime, nowdate
-from six import string_types
 
 import erpnext
 from erpnext.controllers.accounts_controller import AccountsController
@@ -321,7 +320,7 @@
 @frappe.whitelist()
 def unpledge_security(loan=None, loan_security_pledge=None, security_map=None, as_dict=0, save=0, submit=0, approve=0):
 	# if no security_map is passed it will be considered as full unpledge
-	if security_map and isinstance(security_map, string_types):
+	if security_map and isinstance(security_map, str):
 		security_map = json.loads(security_map)
 
 	if loan:
diff --git a/erpnext/loan_management/doctype/loan/loan_dashboard.py b/erpnext/loan_management/doctype/loan/loan_dashboard.py
index 0374eda..c8a9e64 100644
--- a/erpnext/loan_management/doctype/loan/loan_dashboard.py
+++ b/erpnext/loan_management/doctype/loan/loan_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'loan',
diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py
index d2eb53b..24d8d68 100644
--- a/erpnext/loan_management/doctype/loan_application/loan_application.py
+++ b/erpnext/loan_management/doctype/loan_application/loan_application.py
@@ -10,7 +10,6 @@
 from frappe.model.document import Document
 from frappe.model.mapper import get_mapped_doc
 from frappe.utils import cint, flt, rounded
-from six import string_types
 
 from erpnext.loan_management.doctype.loan.loan import (
 	get_monthly_repayment_amount,
@@ -190,7 +189,7 @@
 #This is a sandbox method to get the proposed pledges
 @frappe.whitelist()
 def get_proposed_pledge(securities):
-	if isinstance(securities, string_types):
+	if isinstance(securities, str):
 		securities = json.loads(securities)
 
 	proposed_pledges = {
diff --git a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py
index 01ef9f9..e8e2a2a 100644
--- a/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py
+++ b/erpnext/loan_management/doctype/loan_application/loan_application_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'loan_application',
diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
index 42f9a2c..5922e4f 100644
--- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
+++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import add_days, cint, date_diff, flt, get_datetime, getdate
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.general_ledger import make_gl_entries
@@ -187,7 +186,7 @@
 		# interest_paid = self.amount_paid - self.principal_amount_paid - self.penalty_amount
 
 		if interest_paid > 0:
-			for lia, amounts in iteritems(repayment_details.get('pending_accrual_entries', [])):
+			for lia, amounts in repayment_details.get('pending_accrual_entries', []).items():
 				if amounts['interest_amount'] + amounts['payable_principal_amount'] <= interest_paid:
 					interest_amount = amounts['interest_amount']
 					paid_principal = amounts['payable_principal_amount']
diff --git a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py
index 8d5c525..964a1ae 100644
--- a/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py
+++ b/erpnext/loan_management/doctype/loan_security/loan_security_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'loan_security',
diff --git a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py
index daa9958..2a9ceed 100644
--- a/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py
+++ b/erpnext/loan_management/doctype/loan_security_type/loan_security_type_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'loan_security_type',
diff --git a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py
index 8fce09c..bff9d5c 100644
--- a/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py
+++ b/erpnext/loan_management/doctype/loan_security_unpledge/loan_security_unpledge.py
@@ -6,7 +6,6 @@
 from frappe import _
 from frappe.model.document import Document
 from frappe.utils import flt, get_datetime, getdate
-from six import iteritems
 
 
 class LoanSecurityUnpledge(Document):
@@ -109,7 +108,7 @@
 			pledged_qty = 0
 			current_pledges = get_pledged_security_qty(self.loan)
 
-			for security, qty in iteritems(current_pledges):
+			for security, qty in current_pledges.items():
 				pledged_qty += qty
 
 			if not pledged_qty:
@@ -142,7 +141,7 @@
 		GROUP BY p.loan_security
 	""", (loan)))
 
-	for security, qty in iteritems(pledges):
+	for security, qty in pledges.items():
 		current_pledges.setdefault(security, qty)
 		current_pledges[security] -= unpledges.get(security, 0.0)
 
diff --git a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py
index 19026da..245e102 100644
--- a/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py
+++ b/erpnext/loan_management/doctype/loan_type/loan_type_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'loan_type',
diff --git a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py
index 4195960..932087c 100644
--- a/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py
+++ b/erpnext/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'process_loan_interest_accrual',
diff --git a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py
index fa9d18b..1f5d843 100644
--- a/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py
+++ b/erpnext/loan_management/doctype/process_loan_security_shortfall/process_loan_security_shortfall_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'process_loan_security_shortfall',
diff --git a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py
index 8ebca39..512b47f 100644
--- a/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py
+++ b/erpnext/loan_management/report/applicant_wise_loan_security_exposure/applicant_wise_loan_security_exposure.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 import erpnext
 
@@ -44,7 +43,7 @@
 
 	currency = erpnext.get_company_currency(filters.get('company'))
 
-	for key, qty in iteritems(pledge_values):
+	for key, qty in pledge_values.items():
 		if qty:
 			row = {}
 			current_value = flt(qty * loan_security_details.get(key[1], {}).get('latest_price', 0))
diff --git a/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py b/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py
index e3d9995..7dbb966 100644
--- a/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py
+++ b/erpnext/loan_management/report/loan_security_exposure/loan_security_exposure.py
@@ -4,7 +4,6 @@
 
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 import erpnext
 from erpnext.loan_management.report.applicant_wise_loan_security_exposure.applicant_wise_loan_security_exposure import (
@@ -43,7 +42,7 @@
 	current_pledges, total_portfolio_value = get_company_wise_loan_security_details(filters, loan_security_details)
 	currency = erpnext.get_company_currency(filters.get('company'))
 
-	for security, value in iteritems(current_pledges):
+	for security, value in current_pledges.items():
 		if value.get('qty'):
 			row = {}
 			current_value = flt(value.get('qty', 0) * loan_security_details.get(security, {}).get('latest_price', 0))
@@ -70,7 +69,7 @@
 
 	total_portfolio_value = 0
 	security_wise_map = {}
-	for key, qty in iteritems(pledge_values):
+	for key, qty in pledge_values.items():
 		security_wise_map.setdefault(key[1], {
 			'qty': 0.0,
 			'applicant_count': 0.0
diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py
index 2556f2f..c6745c8 100644
--- a/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py
+++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'blanket_order',
diff --git a/erpnext/manufacturing/doctype/bom/bom_dashboard.py b/erpnext/manufacturing/doctype/bom/bom_dashboard.py
index 9b8f6bf..0699f74 100644
--- a/erpnext/manufacturing/doctype/bom/bom_dashboard.py
+++ b/erpnext/manufacturing/doctype/bom/bom_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py
index f9c3b06..0e3955f 100644
--- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py
+++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py
@@ -9,7 +9,6 @@
 from frappe import _
 from frappe.model.document import Document
 from frappe.utils import cstr, flt
-from six import string_types
 
 from erpnext.manufacturing.doctype.bom.bom import get_boms_in_bottom_up_order
 
@@ -79,7 +78,7 @@
 
 @frappe.whitelist()
 def enqueue_replace_bom(args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	frappe.enqueue("erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.replace_bom", args=args, timeout=40000)
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
index f8f6af3..acaa895 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/doctype/operation/operation_dashboard.py b/erpnext/manufacturing/doctype/operation/operation_dashboard.py
index 076f666..4fbcf49 100644
--- a/erpnext/manufacturing/doctype/operation/operation_dashboard.py
+++ b/erpnext/manufacturing/doctype/operation/operation_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index a63ed99..7cec7f5 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -20,7 +20,6 @@
 	nowdate,
 )
 from frappe.utils.csvutils import build_csv_response
-from six import iteritems
 
 from erpnext.manufacturing.doctype.bom.bom import get_children, validate_bom_no
 from erpnext.manufacturing.doctype.work_order.work_order import get_item_details
@@ -906,7 +905,7 @@
 
 		sales_order = doc.get("sales_order")
 
-		for item_code, details in iteritems(item_details):
+		for item_code, details in item_details.items():
 			so_item_details.setdefault(sales_order, frappe._dict())
 			if item_code in so_item_details.get(sales_order, {}):
 				so_item_details[sales_order][item_code]['qty'] = so_item_details[sales_order][item_code].get("qty", 0) + flt(details.qty)
@@ -914,7 +913,7 @@
 				so_item_details[sales_order][item_code] = details
 
 	mr_items = []
-	for sales_order, item_code in iteritems(so_item_details):
+	for sales_order, item_code in so_item_details.items():
 		item_dict = so_item_details[sales_order]
 		for details in item_dict.values():
 			bin_dict = get_bin_details(details, doc.company, warehouse)
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
index ef00976..e13f042 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/doctype/routing/routing_dashboard.py b/erpnext/manufacturing/doctype/routing/routing_dashboard.py
index 4bd4192..d051e38 100644
--- a/erpnext/manufacturing/doctype/routing/routing_dashboard.py
+++ b/erpnext/manufacturing/doctype/routing/routing_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'routing',
diff --git a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
index 91279d8..37dd11a 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py
index c779fbf..bc481ca 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py
+++ b/erpnext/manufacturing/doctype/workstation/workstation_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py
index 19b550f..02e3e93 100644
--- a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py
+++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py
index d21357a..54bc94b 100644
--- a/erpnext/non_profit/doctype/donation/donation.py
+++ b/erpnext/non_profit/doctype/donation/donation.py
@@ -5,7 +5,6 @@
 import json
 
 import frappe
-import six
 from frappe import _
 from frappe.email import sendmail_to_system_managers
 from frappe.model.document import Document
@@ -83,7 +82,7 @@
 		notify_failure(log)
 		return { 'status': 'Failed', 'reason': e }
 
-	if isinstance(data, six.string_types):
+	if isinstance(data, str):
 		data = json.loads(data)
 	data = frappe._dict(data)
 
diff --git a/erpnext/non_profit/doctype/donation/donation_dashboard.py b/erpnext/non_profit/doctype/donation/donation_dashboard.py
index 1d43ba2..492ad62 100644
--- a/erpnext/non_profit/doctype/donation/donation_dashboard.py
+++ b/erpnext/non_profit/doctype/donation/donation_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/non_profit/doctype/member/member_dashboard.py b/erpnext/non_profit/doctype/member/member_dashboard.py
index 80bb9e3..0e31e3c 100644
--- a/erpnext/non_profit/doctype/member/member_dashboard.py
+++ b/erpnext/non_profit/doctype/member/member_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index b3593d5..beb38e2 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -6,7 +6,6 @@
 from datetime import datetime
 
 import frappe
-import six
 from frappe import _
 from frappe.email import sendmail_to_system_managers
 from frappe.model.document import Document
@@ -343,7 +342,7 @@
 		notify_failure(log)
 		return {"status": "Failed", "reason": e}
 
-	if isinstance(data, six.string_types):
+	if isinstance(data, str):
 		data = json.loads(data)
 	data = frappe._dict(data)
 
diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.py b/erpnext/non_profit/web_form/certification_application/certification_application.py
index 19b550f..02e3e93 100644
--- a/erpnext/non_profit/web_form/certification_application/certification_application.py
+++ b/erpnext/non_profit/web_form/certification_application/certification_application.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py
index 19b550f..02e3e93 100644
--- a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py
+++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/non_profit/web_form/grant_application/grant_application.py b/erpnext/non_profit/web_form/grant_application/grant_application.py
index 1f82894..3dfb381 100644
--- a/erpnext/non_profit/web_form/grant_application/grant_application.py
+++ b/erpnext/non_profit/web_form/grant_application/grant_application.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	context.no_cache = True
 	context.parents = [dict(label='View All ',
diff --git a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
index 00d0dd7..a2deab6 100644
--- a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
+++ b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py b/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py
index 152c5b3..525d1ff 100644
--- a/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py
+++ b/erpnext/patches/v10_0/rename_price_to_rate_in_pricing_rule.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v10_0/set_currency_in_pricing_rule.py b/erpnext/patches/v10_0/set_currency_in_pricing_rule.py
index 374df2a..3f3d424 100644
--- a/erpnext/patches/v10_0/set_currency_in_pricing_rule.py
+++ b/erpnext/patches/v10_0/set_currency_in_pricing_rule.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v10_0/update_translatable_fields.py b/erpnext/patches/v10_0/update_translatable_fields.py
index f111ac7..471f537 100644
--- a/erpnext/patches/v10_0/update_translatable_fields.py
+++ b/erpnext/patches/v10_0/update_translatable_fields.py
@@ -1,6 +1,3 @@
-#-*- coding: utf-8 -*-
-
-
 import frappe
 
 
diff --git a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
index dcb4a57..6530b81 100644
--- a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
+++ b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
index 784b0ee..08006ad 100644
--- a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
+++ b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
@@ -1,4 +1,3 @@
-
 import os
 
 import frappe
diff --git a/erpnext/patches/v11_0/add_default_email_template_for_leave.py b/erpnext/patches/v11_0/add_default_email_template_for_leave.py
index e52d124..fdf3046 100644
--- a/erpnext/patches/v11_0/add_default_email_template_for_leave.py
+++ b/erpnext/patches/v11_0/add_default_email_template_for_leave.py
@@ -1,4 +1,3 @@
-
 import os
 
 import frappe
diff --git a/erpnext/patches/v11_0/add_expense_claim_default_account.py b/erpnext/patches/v11_0/add_expense_claim_default_account.py
index 8629798..f5658c5 100644
--- a/erpnext/patches/v11_0/add_expense_claim_default_account.py
+++ b/erpnext/patches/v11_0/add_expense_claim_default_account.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/add_market_segments.py b/erpnext/patches/v11_0/add_market_segments.py
index 8201995..6dcbf99 100644
--- a/erpnext/patches/v11_0/add_market_segments.py
+++ b/erpnext/patches/v11_0/add_market_segments.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.setup.setup_wizard.operations.install_fixtures import add_market_segments
diff --git a/erpnext/patches/v11_0/add_sales_stages.py b/erpnext/patches/v11_0/add_sales_stages.py
index 1699572..064b721 100644
--- a/erpnext/patches/v11_0/add_sales_stages.py
+++ b/erpnext/patches/v11_0/add_sales_stages.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.setup.setup_wizard.operations.install_fixtures import add_sale_stages
diff --git a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
index 039238f..5730212 100644
--- a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
+++ b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/create_default_success_action.py b/erpnext/patches/v11_0/create_default_success_action.py
index b45065c..e7b412c 100644
--- a/erpnext/patches/v11_0/create_default_success_action.py
+++ b/erpnext/patches/v11_0/create_default_success_action.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.setup.install import create_default_success_action
diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py
index a4cba0c..034418c 100644
--- a/erpnext/patches/v11_0/create_department_records_for_each_company.py
+++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 from frappe.utils.nestedset import rebuild_tree
diff --git a/erpnext/patches/v11_0/drop_column_max_days_allowed.py b/erpnext/patches/v11_0/drop_column_max_days_allowed.py
index 5c54925..f0803cb 100644
--- a/erpnext/patches/v11_0/drop_column_max_days_allowed.py
+++ b/erpnext/patches/v11_0/drop_column_max_days_allowed.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
index a7e662c..5974e27 100644
--- a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
+++ b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v11_0/hr_ux_cleanups.py b/erpnext/patches/v11_0/hr_ux_cleanups.py
index 00678c7..43c8504 100644
--- a/erpnext/patches/v11_0/hr_ux_cleanups.py
+++ b/erpnext/patches/v11_0/hr_ux_cleanups.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/inter_state_field_for_gst.py b/erpnext/patches/v11_0/inter_state_field_for_gst.py
index d897941..a1f1594 100644
--- a/erpnext/patches/v11_0/inter_state_field_for_gst.py
+++ b/erpnext/patches/v11_0/inter_state_field_for_gst.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
index fc3dbfb..80e5ef7 100644
--- a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
+++ b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v11_0/rebuild_tree_for_company.py b/erpnext/patches/v11_0/rebuild_tree_for_company.py
index 7866cfa..cad9c6c 100644
--- a/erpnext/patches/v11_0/rebuild_tree_for_company.py
+++ b/erpnext/patches/v11_0/rebuild_tree_for_company.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils.nestedset import rebuild_tree
 
diff --git a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
index 85292e8..8fa876d 100644
--- a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
+++ b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 # this patch should have been included with this PR https://github.com/frappe/erpnext/pull/14302
diff --git a/erpnext/patches/v11_0/rename_field_max_days_allowed.py b/erpnext/patches/v11_0/rename_field_max_days_allowed.py
index fb08be8..4b55aa0 100644
--- a/erpnext/patches/v11_0/rename_field_max_days_allowed.py
+++ b/erpnext/patches/v11_0/rename_field_max_days_allowed.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v11_0/rename_members_with_naming_series.py b/erpnext/patches/v11_0/rename_members_with_naming_series.py
index 49dbc8a..95fb55d 100644
--- a/erpnext/patches/v11_0/rename_members_with_naming_series.py
+++ b/erpnext/patches/v11_0/rename_members_with_naming_series.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py
index fd7e684..3f87550 100644
--- a/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py
+++ b/erpnext/patches/v11_0/rename_supplier_type_to_supplier_group.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/set_default_email_template_in_hr.py b/erpnext/patches/v11_0/set_default_email_template_in_hr.py
index a77dee9..ee083ca 100644
--- a/erpnext/patches/v11_0/set_default_email_template_in_hr.py
+++ b/erpnext/patches/v11_0/set_default_email_template_in_hr.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py
index a3ece7f..b1098ab 100644
--- a/erpnext/patches/v11_0/set_department_for_doctypes.py
+++ b/erpnext/patches/v11_0/set_department_for_doctypes.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 # Set department value based on employee value
diff --git a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
index 262ca2d..ec75d45 100644
--- a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
+++ b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
diff --git a/erpnext/patches/v11_0/set_salary_component_properties.py b/erpnext/patches/v11_0/set_salary_component_properties.py
index 5ff9e4a..99c3b0b 100644
--- a/erpnext/patches/v11_0/set_salary_component_properties.py
+++ b/erpnext/patches/v11_0/set_salary_component_properties.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
index f23018d..a44daaa 100644
--- a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
+++ b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.workflow import get_workflow_name
 
diff --git a/erpnext/patches/v11_0/set_user_permissions_for_department.py b/erpnext/patches/v11_0/set_user_permissions_for_department.py
index cb38beb..bb7ef87 100644
--- a/erpnext/patches/v11_0/set_user_permissions_for_department.py
+++ b/erpnext/patches/v11_0/set_user_permissions_for_department.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
index 8e2aa47..d387577 100644
--- a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
+++ b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.desk.form.linked_with import get_linked_doctypes
 
diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py
index 854f522..81e547b 100644
--- a/erpnext/patches/v11_0/uom_conversion_data.py
+++ b/erpnext/patches/v11_0/uom_conversion_data.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_0/update_department_lft_rgt.py b/erpnext/patches/v11_0/update_department_lft_rgt.py
index 4cb2dcc..aff8e15 100644
--- a/erpnext/patches/v11_0/update_department_lft_rgt.py
+++ b/erpnext/patches/v11_0/update_department_lft_rgt.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 from frappe.utils.nestedset import rebuild_tree
diff --git a/erpnext/patches/v11_0/update_sales_partner_type.py b/erpnext/patches/v11_0/update_sales_partner_type.py
index c7937e5..ef58499f 100644
--- a/erpnext/patches/v11_0/update_sales_partner_type.py
+++ b/erpnext/patches/v11_0/update_sales_partner_type.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py
index 09bb02f..4e807b4 100644
--- a/erpnext/patches/v11_0/update_total_qty_field.py
+++ b/erpnext/patches/v11_0/update_total_qty_field.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_1/set_missing_opportunity_from.py b/erpnext/patches/v11_1/set_missing_opportunity_from.py
index 7a04191..beec63a 100644
--- a/erpnext/patches/v11_1/set_missing_opportunity_from.py
+++ b/erpnext/patches/v11_1/set_missing_opportunity_from.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_1/set_salary_details_submittable.py b/erpnext/patches/v11_1/set_salary_details_submittable.py
index 8ad8ff8c..ac082b1 100644
--- a/erpnext/patches/v11_1/set_salary_details_submittable.py
+++ b/erpnext/patches/v11_1/set_salary_details_submittable.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py b/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py
index 2da1ecb..0d4f3d2 100644
--- a/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py
+++ b/erpnext/patches/v11_1/set_status_for_material_request_type_manufacture.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_1/setup_guardian_role.py b/erpnext/patches/v11_1/setup_guardian_role.py
index 385bc20..dd9c1d2 100644
--- a/erpnext/patches/v11_1/setup_guardian_role.py
+++ b/erpnext/patches/v11_1/setup_guardian_role.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v11_1/woocommerce_set_creation_user.py b/erpnext/patches/v11_1/woocommerce_set_creation_user.py
index 1de25bb..19958ee 100644
--- a/erpnext/patches/v11_1/woocommerce_set_creation_user.py
+++ b/erpnext/patches/v11_1/woocommerce_set_creation_user.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import cint
 
diff --git a/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py b/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py
index 4126481..f860cb4 100644
--- a/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py
+++ b/erpnext/patches/v12_0/add_document_type_field_for_italy_einvoicing.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 
diff --git a/erpnext/patches/v12_0/add_export_type_field_in_party_master.py b/erpnext/patches/v12_0/add_export_type_field_in_party_master.py
index df9bbea..dc9e884 100644
--- a/erpnext/patches/v12_0/add_export_type_field_in_party_master.py
+++ b/erpnext/patches/v12_0/add_export_type_field_in_party_master.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py b/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py
index 77b6348..6316bb3 100644
--- a/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py
+++ b/erpnext/patches/v12_0/add_gst_category_in_delivery_note.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 
diff --git a/erpnext/patches/v12_0/add_taxjar_integration_field.py b/erpnext/patches/v12_0/add_taxjar_integration_field.py
index fbaf6f8..b0ddf00 100644
--- a/erpnext/patches/v12_0/add_taxjar_integration_field.py
+++ b/erpnext/patches/v12_0/add_taxjar_integration_field.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.united_states.setup import make_custom_fields
diff --git a/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py b/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py
index e0ed9d8..aec9cb8 100644
--- a/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py
+++ b/erpnext/patches/v12_0/create_accounting_dimensions_in_missing_doctypes.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_field
 
diff --git a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py
index 0f5e07b..efcc7cf 100644
--- a/erpnext/patches/v12_0/create_irs_1099_field_united_states.py
+++ b/erpnext/patches/v12_0/create_irs_1099_field_united_states.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.united_states.setup import make_custom_fields
diff --git a/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py b/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py
index 7a1da52..d157aad 100644
--- a/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py
+++ b/erpnext/patches/v12_0/create_itc_reversal_custom_fields.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 from frappe.custom.doctype.property_setter.property_setter import make_property_setter
diff --git a/erpnext/patches/v12_0/create_taxable_value_field.py b/erpnext/patches/v12_0/create_taxable_value_field.py
index df0269d..55717cc 100644
--- a/erpnext/patches/v12_0/create_taxable_value_field.py
+++ b/erpnext/patches/v12_0/create_taxable_value_field.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 
diff --git a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
index c0b2623..b3ee340 100644
--- a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
+++ b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py b/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py
index 677a564..905aebe 100644
--- a/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py
+++ b/erpnext/patches/v12_0/move_item_tax_to_item_tax_template.py
@@ -2,7 +2,6 @@
 
 import frappe
 from frappe.model.naming import make_autoname
-from six import iteritems
 
 
 def execute():
@@ -84,7 +83,7 @@
 
 def get_item_tax_template(item_tax_templates, item_tax_map, item_code, parenttype=None, parent=None, tax_types=None):
 	# search for previously created item tax template by comparing tax maps
-	for template, item_tax_template_map in iteritems(item_tax_templates):
+	for template, item_tax_template_map in item_tax_templates.items():
 		if item_tax_map == item_tax_template_map:
 			return template
 
@@ -92,7 +91,7 @@
 	item_tax_template = frappe.new_doc("Item Tax Template")
 	item_tax_template.title = make_autoname("Item Tax Template-.####")
 
-	for tax_type, tax_rate in iteritems(item_tax_map):
+	for tax_type, tax_rate in item_tax_map.items():
 		account_details = frappe.db.get_value("Account", tax_type, ['name', 'account_type', 'company'], as_dict=1)
 		if account_details:
 			item_tax_template.company = account_details.company
diff --git a/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py b/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py
index c89e4bb..9b083ca 100644
--- a/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py
+++ b/erpnext/patches/v12_0/recalculate_requested_qty_in_bin.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.stock.stock_balance import get_indented_qty, update_bin_qty
diff --git a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py
index 0f4a366..12768a6 100644
--- a/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py
+++ b/erpnext/patches/v12_0/remove_bank_remittance_custom_fields.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/rename_account_type_doctype.py b/erpnext/patches/v12_0/rename_account_type_doctype.py
index c2c834b..e33a1d0 100644
--- a/erpnext/patches/v12_0/rename_account_type_doctype.py
+++ b/erpnext/patches/v12_0/rename_account_type_doctype.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/rename_lost_reason_detail.py b/erpnext/patches/v12_0/rename_lost_reason_detail.py
index 55bf6f2..96ae979 100644
--- a/erpnext/patches/v12_0/rename_lost_reason_detail.py
+++ b/erpnext/patches/v12_0/rename_lost_reason_detail.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py b/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py
index b4f8a06..8f29fc8 100644
--- a/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py
+++ b/erpnext/patches/v12_0/set_automatically_process_deferred_accounting_in_accounts_settings.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py b/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py
index fe580ce..d1e0e45 100644
--- a/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py
+++ b/erpnext/patches/v12_0/set_cwip_and_delete_asset_settings.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import cint
 
diff --git a/erpnext/patches/v12_0/set_default_payroll_based_on.py b/erpnext/patches/v12_0/set_default_payroll_based_on.py
index b70bb18..de641c6 100644
--- a/erpnext/patches/v12_0/set_default_payroll_based_on.py
+++ b/erpnext/patches/v12_0/set_default_payroll_based_on.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py b/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py
index 47d4eb5..50d9fee 100644
--- a/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py
+++ b/erpnext/patches/v12_0/set_expense_account_in_landed_cost_voucher_taxes.py
@@ -1,6 +1,4 @@
-
 import frappe
-from six import iteritems
 
 
 def execute():
@@ -10,7 +8,7 @@
 		SELECT name, expenses_included_in_valuation from `tabCompany`
 	"""))
 
-	for company, account in iteritems(company_account_map):
+	for company, account in company_account_map.items():
 		frappe.db.sql("""
 			UPDATE
 				`tabLanded Cost Taxes and Charges` t, `tabLanded Cost Voucher` l
diff --git a/erpnext/patches/v12_0/set_production_capacity_in_workstation.py b/erpnext/patches/v12_0/set_production_capacity_in_workstation.py
index 14956a2..bd2f7e2 100644
--- a/erpnext/patches/v12_0/set_production_capacity_in_workstation.py
+++ b/erpnext/patches/v12_0/set_production_capacity_in_workstation.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py b/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py
index 05b86f3..a15166e 100644
--- a/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py
+++ b/erpnext/patches/v12_0/set_purchase_receipt_delivery_note_detail.py
@@ -1,4 +1,3 @@
-
 from collections import defaultdict
 
 import frappe
diff --git a/erpnext/patches/v12_0/set_quotation_status.py b/erpnext/patches/v12_0/set_quotation_status.py
index adfc5e9..91e77e4 100644
--- a/erpnext/patches/v12_0/set_quotation_status.py
+++ b/erpnext/patches/v12_0/set_quotation_status.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py b/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py
index 83db796..d41134d 100644
--- a/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py
+++ b/erpnext/patches/v12_0/set_received_qty_in_material_request_as_per_stock_uom.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/set_serial_no_status.py b/erpnext/patches/v12_0/set_serial_no_status.py
index 57206ce..8c136e6 100644
--- a/erpnext/patches/v12_0/set_serial_no_status.py
+++ b/erpnext/patches/v12_0/set_serial_no_status.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import getdate, nowdate
 
diff --git a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
index d79628f..154d7ba 100644
--- a/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
+++ b/erpnext/patches/v12_0/set_valid_till_date_in_supplier_quotation.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py b/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py
index 1a677f9..5b5f623 100644
--- a/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py
+++ b/erpnext/patches/v12_0/unset_customer_supplier_based_on_type_of_item_price.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_bom_in_so_mr.py b/erpnext/patches/v12_0/update_bom_in_so_mr.py
index 7683031..37d850f 100644
--- a/erpnext/patches/v12_0/update_bom_in_so_mr.py
+++ b/erpnext/patches/v12_0/update_bom_in_so_mr.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_due_date_in_gle.py b/erpnext/patches/v12_0/update_due_date_in_gle.py
index 032c2bb..e4418b0 100644
--- a/erpnext/patches/v12_0/update_due_date_in_gle.py
+++ b/erpnext/patches/v12_0/update_due_date_in_gle.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py b/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py
index 48febc5..ef4204f 100644
--- a/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py
+++ b/erpnext/patches/v12_0/update_end_date_and_status_in_email_campaign.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import add_days, getdate, today
 
diff --git a/erpnext/patches/v12_0/update_ewaybill_field_position.py b/erpnext/patches/v12_0/update_ewaybill_field_position.py
index ace3ace..132fd90 100644
--- a/erpnext/patches/v12_0/update_ewaybill_field_position.py
+++ b/erpnext/patches/v12_0/update_ewaybill_field_position.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_gst_category.py b/erpnext/patches/v12_0/update_gst_category.py
index 20dce94..8b15370 100644
--- a/erpnext/patches/v12_0/update_gst_category.py
+++ b/erpnext/patches/v12_0/update_gst_category.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_healthcare_refactored_changes.py b/erpnext/patches/v12_0/update_healthcare_refactored_changes.py
index 4e24a63..f553ee9 100644
--- a/erpnext/patches/v12_0/update_healthcare_refactored_changes.py
+++ b/erpnext/patches/v12_0/update_healthcare_refactored_changes.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 from frappe.modules import get_doctype_module, scrub
diff --git a/erpnext/patches/v12_0/update_is_cancelled_field.py b/erpnext/patches/v12_0/update_is_cancelled_field.py
index 1878784..df78750 100644
--- a/erpnext/patches/v12_0/update_is_cancelled_field.py
+++ b/erpnext/patches/v12_0/update_is_cancelled_field.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_item_tax_template_company.py b/erpnext/patches/v12_0/update_item_tax_template_company.py
index a737cb2..abd4f6f 100644
--- a/erpnext/patches/v12_0/update_item_tax_template_company.py
+++ b/erpnext/patches/v12_0/update_item_tax_template_company.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py b/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py
index 53e8321..e5f24d4 100644
--- a/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py
+++ b/erpnext/patches/v12_0/update_owner_fields_in_acc_dimension_custom_fields.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
diff --git a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py
index e0382d8..ea3e002 100644
--- a/erpnext/patches/v12_0/update_price_list_currency_in_bom.py
+++ b/erpnext/patches/v12_0/update_price_list_currency_in_bom.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import getdate
 
diff --git a/erpnext/patches/v12_0/update_price_or_product_discount.py b/erpnext/patches/v12_0/update_price_or_product_discount.py
index 86105a4..53c0ba5 100644
--- a/erpnext/patches/v12_0/update_price_or_product_discount.py
+++ b/erpnext/patches/v12_0/update_price_or_product_discount.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v12_0/update_uom_conversion_factor.py b/erpnext/patches/v12_0/update_uom_conversion_factor.py
index 3184d11..a09ac19 100644
--- a/erpnext/patches/v12_0/update_uom_conversion_factor.py
+++ b/erpnext/patches/v12_0/update_uom_conversion_factor.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/add_default_interview_notification_templates.py b/erpnext/patches/v13_0/add_default_interview_notification_templates.py
index 8d9f5cc..0208ca9 100644
--- a/erpnext/patches/v13_0/add_default_interview_notification_templates.py
+++ b/erpnext/patches/v13_0/add_default_interview_notification_templates.py
@@ -1,4 +1,3 @@
-
 import os
 
 import frappe
diff --git a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py
index 3bf2762..71abe2e 100644
--- a/erpnext/patches/v13_0/add_naming_series_to_old_projects.py
+++ b/erpnext/patches/v13_0/add_naming_series_to_old_projects.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/add_po_to_global_search.py b/erpnext/patches/v13_0/add_po_to_global_search.py
index 396d334..7fbaffb 100644
--- a/erpnext/patches/v13_0/add_po_to_global_search.py
+++ b/erpnext/patches/v13_0/add_po_to_global_search.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/add_standard_navbar_items.py b/erpnext/patches/v13_0/add_standard_navbar_items.py
index c739a7a..24141b7 100644
--- a/erpnext/patches/v13_0/add_standard_navbar_items.py
+++ b/erpnext/patches/v13_0/add_standard_navbar_items.py
@@ -1,4 +1,3 @@
-
 # import frappe
 from erpnext.setup.install import add_standard_navbar_items
 
diff --git a/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py
index a95f822..ee23747 100644
--- a/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py
+++ b/erpnext/patches/v13_0/bill_for_rejected_quantity_in_purchase_invoice.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/change_default_pos_print_format.py b/erpnext/patches/v13_0/change_default_pos_print_format.py
index 9664247..23cad31 100644
--- a/erpnext/patches/v13_0/change_default_pos_print_format.py
+++ b/erpnext/patches/v13_0/change_default_pos_print_format.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py
index 7ef154e..bc64c63 100644
--- a/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py
+++ b/erpnext/patches/v13_0/convert_qi_parameter_to_link_field.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/custom_fields_for_taxjar_integration.py b/erpnext/patches/v13_0/custom_fields_for_taxjar_integration.py
index ce352a0..fba9e2c 100644
--- a/erpnext/patches/v13_0/custom_fields_for_taxjar_integration.py
+++ b/erpnext/patches/v13_0/custom_fields_for_taxjar_integration.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 
diff --git a/erpnext/patches/v13_0/drop_razorpay_payload_column.py b/erpnext/patches/v13_0/drop_razorpay_payload_column.py
index aea498d..611ba7e 100644
--- a/erpnext/patches/v13_0/drop_razorpay_payload_column.py
+++ b/erpnext/patches/v13_0/drop_razorpay_payload_column.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/gst_fields_for_pos_invoice.py b/erpnext/patches/v13_0/gst_fields_for_pos_invoice.py
index cb3df3c..76f8b27 100644
--- a/erpnext/patches/v13_0/gst_fields_for_pos_invoice.py
+++ b/erpnext/patches/v13_0/gst_fields_for_pos_invoice.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
 
diff --git a/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py b/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py
index d43e793..98ce12b 100644
--- a/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py
+++ b/erpnext/patches/v13_0/healthcare_lab_module_rename_doctypes.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v13_0/make_non_standard_user_type.py b/erpnext/patches/v13_0/make_non_standard_user_type.py
index 9faf298..a7bdf93 100644
--- a/erpnext/patches/v13_0/make_non_standard_user_type.py
+++ b/erpnext/patches/v13_0/make_non_standard_user_type.py
@@ -3,7 +3,6 @@
 
 
 import frappe
-from six import iteritems
 
 from erpnext.setup.install import add_non_standard_user_types
 
@@ -15,7 +14,7 @@
 		'hr': ['Employee', 'Expense Claim', 'Leave Application', 'Attendance Request', 'Compensatory Leave Request']
 	}
 
-	for module, doctypes in iteritems(doctype_dict):
+	for module, doctypes in doctype_dict.items():
 		for doctype in doctypes:
 			frappe.reload_doc(module, 'doctype', doctype)
 
diff --git a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
index ad79c81..1c65998 100644
--- a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
+++ b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
@@ -1,4 +1,3 @@
-
 import json
 
 import frappe
diff --git a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
index 3d999bf..7c10a31 100644
--- a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
+++ b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py b/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py
index e977804..3bd717d 100644
--- a/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py
+++ b/erpnext/patches/v13_0/rename_discharge_date_in_ip_record.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py
index ecd0344..265e2a9 100644
--- a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py
+++ b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py b/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py
index f49b1e4..7d757b7 100644
--- a/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py
+++ b/erpnext/patches/v13_0/replace_pos_page_with_point_of_sale_page.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py b/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py
index b955686..f82a0d5 100644
--- a/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py
+++ b/erpnext/patches/v13_0/set_company_field_in_healthcare_doctypes.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py b/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py
index 3b75141..87b3389 100644
--- a/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py
+++ b/erpnext/patches/v13_0/set_payment_channel_in_payment_gateway_account.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/set_pos_closing_as_failed.py b/erpnext/patches/v13_0/set_pos_closing_as_failed.py
index a838ce0..6a3785d 100644
--- a/erpnext/patches/v13_0/set_pos_closing_as_failed.py
+++ b/erpnext/patches/v13_0/set_pos_closing_as_failed.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/set_training_event_attendance.py b/erpnext/patches/v13_0/set_training_event_attendance.py
index 27a9d3f..e44f321 100644
--- a/erpnext/patches/v13_0/set_training_event_attendance.py
+++ b/erpnext/patches/v13_0/set_training_event_attendance.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v13_0/set_youtube_video_id.py b/erpnext/patches/v13_0/set_youtube_video_id.py
index 76aaaea..e1eb1b9 100644
--- a/erpnext/patches/v13_0/set_youtube_video_id.py
+++ b/erpnext/patches/v13_0/set_youtube_video_id.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.utilities.doctype.video.video import get_id_from_url
diff --git a/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py b/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py
index 36bedf4..dc3f8aa 100644
--- a/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py
+++ b/erpnext/patches/v13_0/setting_custom_roles_for_some_regional_reports.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.india.setup import add_custom_roles_for_reports
diff --git a/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py b/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py
index 10ecd09..55fd465 100644
--- a/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py
+++ b/erpnext/patches/v13_0/update_actual_start_and_end_date_in_wo.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2019, Frappe and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/patches/v13_0/update_old_loans.py b/erpnext/patches/v13_0/update_old_loans.py
index bcd80d4..e226f1d 100644
--- a/erpnext/patches/v13_0/update_old_loans.py
+++ b/erpnext/patches/v13_0/update_old_loans.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 from frappe.model.naming import make_autoname
diff --git a/erpnext/patches/v13_0/update_subscription.py b/erpnext/patches/v13_0/update_subscription.py
index b0bb1c8..b67c74d 100644
--- a/erpnext/patches/v13_0/update_subscription.py
+++ b/erpnext/patches/v13_0/update_subscription.py
@@ -3,7 +3,6 @@
 
 
 import frappe
-from six import iteritems
 
 
 def execute():
@@ -34,7 +33,7 @@
 		'Based on price list': 'Based On Price List'
 	}
 
-	for key, value in iteritems(price_determination_map):
+	for key, value in price_determination_map.items():
 		frappe.db.sql("""
 			UPDATE `tabSubscription Plan`
 			SET price_determination = %s
diff --git a/erpnext/patches/v13_0/update_timesheet_changes.py b/erpnext/patches/v13_0/update_timesheet_changes.py
index cc38a0c..a5e3391 100644
--- a/erpnext/patches/v13_0/update_timesheet_changes.py
+++ b/erpnext/patches/v13_0/update_timesheet_changes.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.utils.rename_field import rename_field
 
diff --git a/erpnext/patches/v14_0/update_opportunity_currency_fields.py b/erpnext/patches/v14_0/update_opportunity_currency_fields.py
index 8ef2a94..1307147 100644
--- a/erpnext/patches/v14_0/update_opportunity_currency_fields.py
+++ b/erpnext/patches/v14_0/update_opportunity_currency_fields.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils import flt
 
diff --git a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
index e7ef5ff..c46187c 100644
--- a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
+++ b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/patches/v8_1/setup_gst_india.py b/erpnext/patches/v8_1/setup_gst_india.py
index 98097d0..ff9e6a4 100644
--- a/erpnext/patches/v8_1/setup_gst_india.py
+++ b/erpnext/patches/v8_1/setup_gst_india.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.email import sendmail_to_system_managers
 
diff --git a/erpnext/patches/v8_7/sync_india_custom_fields.py b/erpnext/patches/v8_7/sync_india_custom_fields.py
index b5d58dc..808c833 100644
--- a/erpnext/patches/v8_7/sync_india_custom_fields.py
+++ b/erpnext/patches/v8_7/sync_india_custom_fields.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py b/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py
index 6276bd6..aeadba1 100644
--- a/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py
+++ b/erpnext/payroll/doctype/gratuity/gratuity_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py
index 15e15d1..e7c67fb 100644
--- a/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py
+++ b/erpnext/payroll/doctype/gratuity_rule/gratuity_rule_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py
index 138fed6..a33b28d 100644
--- a/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py
+++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'payroll_entry',
diff --git a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py
index eaa6773..8a3332f 100644
--- a/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py
+++ b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
      return {
         'fieldname': 'payroll_period',
diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py
index 7a5b6d0..05af09e 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py
@@ -21,7 +21,6 @@
 	rounded,
 )
 from frappe.utils.background_jobs import enqueue
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.utils import get_fiscal_year
@@ -1342,7 +1341,7 @@
 			from erpnext.hr.doctype.leave_application.leave_application import get_leave_details
 			leave_details = get_leave_details(self.employee, self.end_date)
 
-			for leave_type, leave_values in iteritems(leave_details['leave_allocation']):
+			for leave_type, leave_values in leave_details['leave_allocation'].items():
 				self.append('leave_details', {
 					'leave_type': leave_type,
 					'total_allocated_leaves': flt(leave_values.get('total_leaves')),
diff --git a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py
index 27eb5ed..014d0ba 100644
--- a/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py
+++ b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'salary_structure',
diff --git a/erpnext/payroll/notification/retention_bonus/retention_bonus.py b/erpnext/payroll/notification/retention_bonus/retention_bonus.py
index 19b550f..02e3e93 100644
--- a/erpnext/payroll/notification/retention_bonus/retention_bonus.py
+++ b/erpnext/payroll/notification/retention_bonus/retention_bonus.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/portal/product_configurator/test_product_configurator.py b/erpnext/portal/product_configurator/test_product_configurator.py
index 7a17d14..b478489 100644
--- a/erpnext/portal/product_configurator/test_product_configurator.py
+++ b/erpnext/portal/product_configurator/test_product_configurator.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py
index d0a5819..974b51e 100644
--- a/erpnext/portal/utils.py
+++ b/erpnext/portal/utils.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.utils.nestedset import get_root_of
 
diff --git a/erpnext/projects/doctype/project/project_dashboard.py b/erpnext/projects/doctype/project/project_dashboard.py
index df274ed..a7d1835 100644
--- a/erpnext/projects/doctype/project/project_dashboard.py
+++ b/erpnext/projects/doctype/project/project_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/projects/doctype/project_template/project_template_dashboard.py b/erpnext/projects/doctype/project_template/project_template_dashboard.py
index 65cd8d4..a03a57d 100644
--- a/erpnext/projects/doctype/project_template/project_template_dashboard.py
+++ b/erpnext/projects/doctype/project_template/project_template_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'project_template',
diff --git a/erpnext/projects/doctype/task/task_dashboard.py b/erpnext/projects/doctype/task/task_dashboard.py
index 40d04e1..f7470f8 100644
--- a/erpnext/projects/doctype/task/task_dashboard.py
+++ b/erpnext/projects/doctype/task/task_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/projects/doctype/timesheet/timesheet_dashboard.py b/erpnext/projects/doctype/timesheet/timesheet_dashboard.py
index d9a341d..15fe797 100644
--- a/erpnext/projects/doctype/timesheet/timesheet_dashboard.py
+++ b/erpnext/projects/doctype/timesheet/timesheet_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py b/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py
index 0d97ddf..e2ba7c2 100644
--- a/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py
+++ b/erpnext/projects/report/delayed_tasks_summary/test_delayed_tasks_summary.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
index 2854ea3..dd4f8ea 100644
--- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
+++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt, getdate
-from six import iteritems
 
 
 def execute(filters=None):
@@ -110,7 +109,7 @@
 
 		self.data = []
 
-		for emp, data in iteritems(self.stats_by_employee):
+		for emp, data in self.stats_by_employee.items():
 			row = frappe._dict()
 			row['employee'] = emp
 			row.update(data)
@@ -180,7 +179,7 @@
 
 	def calculate_utilizations(self):
 		TOTAL_HOURS = flt(self.standard_working_hours * self.day_span, 2)
-		for emp, data in iteritems(self.stats_by_employee):
+		for emp, data in self.stats_by_employee.items():
 			data['total_hours'] = TOTAL_HOURS
 			data['untracked_hours'] = flt(TOTAL_HOURS - data['billed_hours'] - data['non_billed_hours'], 2)
 
diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
index 9959382..b500bc8 100644
--- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
+++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/projects/report/project_profitability/test_project_profitability.py b/erpnext/projects/report/project_profitability/test_project_profitability.py
index 31fd361..2cf9d38 100644
--- a/erpnext/projects/report/project_profitability/test_project_profitability.py
+++ b/erpnext/projects/report/project_profitability/test_project_profitability.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/projects/web_form/tasks/tasks.py b/erpnext/projects/web_form/tasks/tasks.py
index 67cad05..99249ed 100644
--- a/erpnext/projects/web_form/tasks/tasks.py
+++ b/erpnext/projects/web_form/tasks/tasks.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/regional/address_template/test_regional_address_template.py b/erpnext/regional/address_template/test_regional_address_template.py
index 9ad3d47..780db40 100644
--- a/erpnext/regional/address_template/test_regional_address_template.py
+++ b/erpnext/regional/address_template/test_regional_address_template.py
@@ -1,4 +1,3 @@
-
 from unittest import TestCase
 
 import frappe
diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py
index 8445408..d48cd67 100644
--- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py
+++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py
@@ -9,7 +9,6 @@
 from frappe import _
 from frappe.model.document import Document
 from frappe.utils import cstr, flt
-from six import iteritems
 
 from erpnext.regional.india import state_numbers
 
@@ -281,7 +280,7 @@
 
 		if self.get('invoice_items'):
 			# Build itemised tax for export invoices, nil and exempted where tax table is blank
-			for invoice, items in iteritems(self.invoice_items):
+			for invoice, items in self.invoice_items.items():
 				if invoice not in self.items_based_on_tax_rate and self.invoice_detail_map.get(invoice, {}).get('export_type') \
 					== "Without Payment of Tax" and self.invoice_detail_map.get(invoice, {}).get('gst_category') == "Overseas":
 					self.items_based_on_tax_rate.setdefault(invoice, {}).setdefault(0, items.keys())
@@ -349,7 +348,7 @@
 							self.report_dict['sup_details']['isup_rev']['txval'] += taxable_value
 
 	def set_inter_state_supply(self, inter_state_supply):
-		for key, value in iteritems(inter_state_supply):
+		for key, value in inter_state_supply.items():
 			if key[0] == "Unregistered":
 				self.report_dict["inter_sup"]["unreg_details"].append(value)
 
diff --git a/erpnext/regional/germany/utils/datev/datev_constants.py b/erpnext/regional/germany/utils/datev/datev_constants.py
index be3d7a3..8f2dc2d 100644
--- a/erpnext/regional/germany/utils/datev/datev_constants.py
+++ b/erpnext/regional/germany/utils/datev/datev_constants.py
@@ -1,4 +1,3 @@
-# coding: utf-8
 """Constants used in datev.py."""
 
 TRANSACTION_COLUMNS = [
diff --git a/erpnext/regional/germany/utils/datev/datev_csv.py b/erpnext/regional/germany/utils/datev/datev_csv.py
index d46abe9..2d1e02e 100644
--- a/erpnext/regional/germany/utils/datev/datev_csv.py
+++ b/erpnext/regional/germany/utils/datev/datev_csv.py
@@ -1,5 +1,3 @@
-# coding: utf-8
-
 import datetime
 import zipfile
 from csv import QUOTE_NONNUMERIC
@@ -45,7 +43,7 @@
 
 	data = result.to_csv(
 		# Reason for str(';'): https://github.com/pandas-dev/pandas/issues/6035
-		sep=str(';'),
+		sep=';',
 		# European decimal seperator
 		decimal=',',
 		# Windows "ANSI" encoding
diff --git a/erpnext/regional/india/__init__.py b/erpnext/regional/india/__init__.py
index 2dc762f..c703575 100644
--- a/erpnext/regional/india/__init__.py
+++ b/erpnext/regional/india/__init__.py
@@ -1,6 +1,4 @@
 
-from six import iteritems
-
 states = [
  '',
  'Andaman and Nicobar Islands',
@@ -82,4 +80,4 @@
  "West Bengal": "19",
 }
 
-number_state_mapping = {v: k for k, v in iteritems(state_numbers)}
+number_state_mapping = {v: k for k, v in state_numbers.items()}
diff --git a/erpnext/regional/india/test_utils.py b/erpnext/regional/india/test_utils.py
index 61a0e97..c95a0b3 100644
--- a/erpnext/regional/india/test_utils.py
+++ b/erpnext/regional/india/test_utils.py
@@ -1,4 +1,3 @@
-
 import unittest
 from unittest.mock import patch
 
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index e7539f5..9efad6d 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -1,4 +1,3 @@
-
 import json
 import re
 
@@ -6,7 +5,6 @@
 from frappe import _
 from frappe.model.utils import get_fetch_values
 from frappe.utils import cint, cstr, date_diff, flt, getdate, nowdate
-from six import string_types
 
 from erpnext.controllers.accounts_controller import get_taxes_and_charges
 from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount
@@ -193,7 +191,7 @@
 
 @frappe.whitelist()
 def get_regional_address_details(party_details, doctype, company):
-	if isinstance(party_details, string_types):
+	if isinstance(party_details, str):
 		party_details = json.loads(party_details)
 		party_details = frappe._dict(party_details)
 
@@ -790,7 +788,7 @@
 	if country != 'India':
 		return
 
-	if isinstance(account_list, string_types):
+	if isinstance(account_list, str):
 		account_list = json.loads(account_list)
 
 	if not frappe.db.get_single_value('GST Settings', 'round_off_gst_values'):
diff --git a/erpnext/regional/italy/__init__.py b/erpnext/regional/italy/__init__.py
index 4932f66..eb20f65 100644
--- a/erpnext/regional/italy/__init__.py
+++ b/erpnext/regional/italy/__init__.py
@@ -1,5 +1,3 @@
-# coding=utf-8
-
 fiscal_regimes = [
     "RF01-Ordinario",
     "RF02-Contribuenti minimi (art.1, c.96-117, L. 244/07)",
diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py
index 8d1558b..c82557b 100644
--- a/erpnext/regional/italy/utils.py
+++ b/erpnext/regional/italy/utils.py
@@ -1,4 +1,3 @@
-
 import io
 import json
 
@@ -6,7 +5,6 @@
 from frappe import _
 from frappe.utils import cstr, flt
 from frappe.utils.file_manager import remove_file
-from six import string_types
 
 from erpnext.controllers.taxes_and_totals import get_itemised_tax
 from erpnext.regional.italy import state_codes
@@ -167,7 +165,7 @@
 		if tax.rate == 0:
 			for item in items:
 				item_tax_rate = item.item_tax_rate
-				if isinstance(item.item_tax_rate, string_types):
+				if isinstance(item.item_tax_rate, str):
 					item_tax_rate = json.loads(item.item_tax_rate)
 
 				if item_tax_rate and tax.account_head in item_tax_rate:
diff --git a/erpnext/regional/report/datev/datev.py b/erpnext/regional/report/datev/datev.py
index 8897322..beac7ed 100644
--- a/erpnext/regional/report/datev/datev.py
+++ b/erpnext/regional/report/datev/datev.py
@@ -1,4 +1,3 @@
-# coding: utf-8
 """
 Provide a report and downloadable CSV according to the German DATEV format.
 
@@ -12,7 +11,6 @@
 
 import frappe
 from frappe import _
-from six import string_types
 
 from erpnext.accounts.utils import get_fiscal_year
 from erpnext.regional.germany.utils.datev.datev_constants import (
@@ -545,7 +543,7 @@
 	Arguments / Params:
 	filters -- dict of filters to be passed to the sql query
 	"""
-	if isinstance(filters, string_types):
+	if isinstance(filters, str):
 		filters = json.loads(filters)
 
 	validate(filters)
diff --git a/erpnext/regional/report/datev/test_datev.py b/erpnext/regional/report/datev/test_datev.py
index 7ca0b1b..14d5495 100644
--- a/erpnext/regional/report/datev/test_datev.py
+++ b/erpnext/regional/report/datev/test_datev.py
@@ -1,5 +1,3 @@
-# coding=utf-8
-
 import zipfile
 from unittest import TestCase
 
diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py
index 933c522..27cfaf7 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -8,7 +8,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt, formatdate, getdate
-from six import iteritems
 
 from erpnext.regional.india.utils import get_gst_accounts
 
@@ -123,7 +122,7 @@
 					row["cess_amount"] += flt(self.invoice_cess.get(inv), 2)
 					row["type"] = "E" if ecommerce_gstin else "OE"
 
-			for key, value in iteritems(b2cs_output):
+			for key, value in b2cs_output.items():
 				self.data.append(value)
 
 	def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, items):
@@ -317,7 +316,7 @@
 				+ "<br>" + "<br>".join(unidentified_gst_accounts), alert=True)
 
 		# Build itemised tax for export invoices where tax table is blank
-		for invoice, items in iteritems(self.invoice_items):
+		for invoice, items in self.invoice_items.items():
 			if invoice not in self.items_based_on_tax_rate and invoice not in unidentified_gst_accounts_invoice \
 				and self.invoices.get(invoice, {}).get('export_type') == "Without Payment of Tax" \
 				and self.invoices.get(invoice, {}).get('gst_category') == "Overseas":
@@ -782,7 +781,7 @@
 		b2b_item, inv = {"ctin": gst_in, "inv": []}, []
 		if not gst_in: continue
 
-		for number, invoice in iteritems(res[gst_in]):
+		for number, invoice in res[gst_in].items():
 			if not invoice[0]["place_of_supply"]:
 				frappe.throw(_("""{0} not entered in Invoice {1}.
 					Please update and try again""").format(frappe.bold("Place Of Supply"),
@@ -851,7 +850,7 @@
 def get_advances_json(data, gstin):
 	company_state_number = gstin[0:2]
 	out = []
-	for place_of_supply, items in iteritems(data):
+	for place_of_supply, items in data.items():
 		supply_type = "INTRA" if company_state_number == place_of_supply.split('-')[0] else "INTER"
 		row = {
 			"pos": place_of_supply.split('-')[0],
@@ -933,7 +932,7 @@
 		cdnr_item, inv = {"ctin": gst_in, "nt": []}, []
 		if not gst_in: continue
 
-		for number, invoice in iteritems(res[gst_in]):
+		for number, invoice in res[gst_in].items():
 			if not invoice[0]["place_of_supply"]:
 				frappe.throw(_("""{0} not entered in Invoice {1}.
 					Please update and try again""").format(frappe.bold("Place Of Supply"),
@@ -964,7 +963,7 @@
 def get_cdnr_unreg_json(res, gstin):
 	out = []
 
-	for invoice, items in iteritems(res):
+	for invoice, items in res.items():
 		inv_item = {
 			"nt_num": items[0]["invoice_number"],
 			"nt_dt": getdate(items[0]["posting_date"]).strftime('%d-%m-%Y'),
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
index 17d6117..e03ad37 100644
--- a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
@@ -8,7 +8,6 @@
 from frappe import _
 from frappe.model.meta import get_field_precision
 from frappe.utils import cstr, flt, getdate
-from six import iteritems
 
 import erpnext
 from erpnext.regional.india.utils import get_gst_accounts
@@ -212,7 +211,7 @@
 				else:
 					merged_hsn_dict[row[0]][d['fieldname']] = row[i]
 
-	for key, value in iteritems(merged_hsn_dict):
+	for key, value in merged_hsn_dict.items():
 		result.append(value)
 
 	return result
diff --git a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py
index 62d694b..4133687 100644
--- a/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py
+++ b/erpnext/regional/report/uae_vat_201/test_uae_vat_201.py
@@ -1,5 +1,3 @@
-# coding=utf-8
-
 from unittest import TestCase
 
 import frappe
diff --git a/erpnext/regional/turkey/setup.py b/erpnext/regional/turkey/setup.py
index aedebdf..1d3770a 100644
--- a/erpnext/regional/turkey/setup.py
+++ b/erpnext/regional/turkey/setup.py
@@ -1,3 +1,2 @@
-
 def setup(company=None, patch=True):
     pass
diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py
index 891e75e..f350ec4 100644
--- a/erpnext/regional/united_arab_emirates/utils.py
+++ b/erpnext/regional/united_arab_emirates/utils.py
@@ -1,8 +1,6 @@
-
 import frappe
 from frappe import _
 from frappe.utils import flt, money_in_words, round_based_on_smallest_currency_fraction
-from six import iteritems
 
 import erpnext
 from erpnext.controllers.taxes_and_totals import get_itemised_tax
@@ -23,7 +21,7 @@
 		# First check if tax rate is present
 		# If not then look up in item_wise_tax_detail
 		if item_tax_rate:
-			for account, rate in iteritems(item_tax_rate):
+			for account, rate in item_tax_rate.items():
 				tax_rate += rate
 		elif row.item_code and itemised_tax.get(row.item_code):
 			tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
diff --git a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
index c91ef56..bfdd052 100644
--- a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
+++ b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/selling/doctype/customer/customer_dashboard.py b/erpnext/selling/doctype/customer/customer_dashboard.py
index faf8a44..58394d0 100644
--- a/erpnext/selling/doctype/customer/customer_dashboard.py
+++ b/erpnext/selling/doctype/customer/customer_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index 83af816..7d6b74d 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -17,7 +17,6 @@
 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 @@
 
 		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
diff --git a/erpnext/selling/doctype/product_bundle/test_product_bundle.py b/erpnext/selling/doctype/product_bundle/test_product_bundle.py
index b966c62..c1e2fde 100644
--- a/erpnext/selling/doctype/product_bundle/test_product_bundle.py
+++ b/erpnext/selling/doctype/product_bundle/test_product_bundle.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/selling/doctype/quotation/quotation_dashboard.py b/erpnext/selling/doctype/quotation/quotation_dashboard.py
index 46de292..0a1aad7 100644
--- a/erpnext/selling/doctype/quotation/quotation_dashboard.py
+++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 1ab8aa4..8cb0f29 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -12,7 +12,6 @@
 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 @@
 	"""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(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 @@
 	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'):
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index abf507a..1e616b8 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
+++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.py b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
index 319e78f..915f8dc 100644
--- a/erpnext/selling/report/address_and_contacts/address_and_contacts.py
+++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
@@ -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 @@
 	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]):
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py
index a380f84..83588c3 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.py
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.py
@@ -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 @@
 		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
diff --git a/erpnext/setup/default_energy_point_rules.py b/erpnext/setup/default_energy_point_rules.py
index cfff75e..1ce06b8 100644
--- a/erpnext/setup/default_energy_point_rules.py
+++ b/erpnext/setup/default_energy_point_rules.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 doctype_rule_map = {
diff --git a/erpnext/setup/default_success_action.py b/erpnext/setup/default_success_action.py
index 338fb43..a1f48df 100644
--- a/erpnext/setup/default_success_action.py
+++ b/erpnext/setup/default_success_action.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 doctype_list = [
diff --git a/erpnext/setup/doctype/company/company_dashboard.py b/erpnext/setup/doctype/company/company_dashboard.py
index b63c05d..7cb0b12 100644
--- a/erpnext/setup/doctype/company/company_dashboard.py
+++ b/erpnext/setup/doctype/company/company_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/setup/doctype/email_digest/quotes.py b/erpnext/setup/doctype/email_digest/quotes.py
index 0fbadd9..fbd2d94 100644
--- a/erpnext/setup/doctype/email_digest/quotes.py
+++ b/erpnext/setup/doctype/email_digest/quotes.py
@@ -1,4 +1,3 @@
-
 import random
 
 
diff --git a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
index d0a5dd9..e946406 100644
--- a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
+++ b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
index 8e6421e..658f286 100644
--- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
+++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
@@ -9,7 +9,6 @@
 from frappe.model.document import Document
 from frappe.utils import cint
 from frappe.utils.jinja import validate_template
-from six import string_types
 
 
 class TermsandConditions(Document):
@@ -21,7 +20,7 @@
 
 @frappe.whitelist()
 def get_terms_and_conditions(template_name, doc):
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 
 	terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py
index 67d1143..86c9b3f 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -8,7 +8,6 @@
 from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
 from frappe.installer import update_site_config
 from frappe.utils import cint
-from six import iteritems
 
 from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
 from erpnext.setup.default_energy_point_rules import get_default_energy_point_rules
@@ -173,12 +172,12 @@
 	user_types = get_user_types_data()
 
 	user_type_limit = {}
-	for user_type, data in iteritems(user_types):
+	for user_type, data in user_types.items():
 		user_type_limit.setdefault(frappe.scrub(user_type), 10)
 
 	update_site_config('user_type_doctype_limit', user_type_limit)
 
-	for user_type, data in iteritems(user_types):
+	for user_type, data in user_types.items():
 		create_custom_role(data)
 		create_user_type(user_type, data)
 
@@ -228,7 +227,7 @@
 	doc.save(ignore_permissions=True)
 
 def create_role_permissions_for_doctype(doc, data):
-	for doctype, perms in iteritems(data.get('doctypes')):
+	for doctype, perms in data.get('doctypes').items():
 		args = {'document_type': doctype}
 		for perm in perms:
 			args[perm] = 1
diff --git a/erpnext/setup/setup_wizard/data/dashboard_charts.py b/erpnext/setup/setup_wizard/data/dashboard_charts.py
index e3b33df..6cb15b2 100644
--- a/erpnext/setup/setup_wizard/data/dashboard_charts.py
+++ b/erpnext/setup/setup_wizard/data/dashboard_charts.py
@@ -1,4 +1,3 @@
-
 import json
 
 import frappe
diff --git a/erpnext/setup/setup_wizard/data/industry_type.py b/erpnext/setup/setup_wizard/data/industry_type.py
index 542dfc7..ecd8b00 100644
--- a/erpnext/setup/setup_wizard/data/industry_type.py
+++ b/erpnext/setup/setup_wizard/data/industry_type.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/setup/setup_wizard/utils.py b/erpnext/setup/setup_wizard/utils.py
index afab7e7..f1ec50af 100644
--- a/erpnext/setup/setup_wizard/utils.py
+++ b/erpnext/setup/setup_wizard/utils.py
@@ -1,4 +1,3 @@
-
 import json
 import os
 
diff --git a/erpnext/startup/__init__.py b/erpnext/startup/__init__.py
index d1933d2..dd1b401 100644
--- a/erpnext/startup/__init__.py
+++ b/erpnext/startup/__init__.py
@@ -1,4 +1,3 @@
-
 # ERPNext - web based ERP (http://erpnext.com)
 # Copyright (C) 2012 Frappe Technologies Pvt Ltd
 #
diff --git a/erpnext/startup/filters.py b/erpnext/startup/filters.py
index c0ccf54..4fd6431 100644
--- a/erpnext/startup/filters.py
+++ b/erpnext/startup/filters.py
@@ -1,6 +1,3 @@
-
-
-
 def get_filters_config():
 	filters_config = {
 		"fiscal year": {
diff --git a/erpnext/startup/leaderboard.py b/erpnext/startup/leaderboard.py
index a92abf1..8ae70d2 100644
--- a/erpnext/startup/leaderboard.py
+++ b/erpnext/startup/leaderboard.py
@@ -1,5 +1,3 @@
-
-
 import frappe
 from frappe.utils import cint
 
diff --git a/erpnext/stock/__init__.py b/erpnext/stock/__init__.py
index 9fd1f0e..e8b2804 100644
--- a/erpnext/stock/__init__.py
+++ b/erpnext/stock/__init__.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/stock/dashboard/item_dashboard.py b/erpnext/stock/dashboard/item_dashboard.py
index 9a83372..57d78a2 100644
--- a/erpnext/stock/dashboard/item_dashboard.py
+++ b/erpnext/stock/dashboard/item_dashboard.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.db_query import DatabaseQuery
 from frappe.utils import cint, flt
diff --git a/erpnext/stock/dashboard/warehouse_capacity_dashboard.py b/erpnext/stock/dashboard/warehouse_capacity_dashboard.py
index e8b0bea..c0666cf 100644
--- a/erpnext/stock/dashboard/warehouse_capacity_dashboard.py
+++ b/erpnext/stock/dashboard/warehouse_capacity_dashboard.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe.model.db_query import DatabaseQuery
 from frappe.utils import flt, nowdate
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 3ce2d87..fdefd24 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -9,7 +9,6 @@
 from frappe.utils import cint, flt, get_link_to_form
 from frappe.utils.data import add_days
 from frappe.utils.jinja import render_template
-from six import text_type
 
 
 class UnableToSelectBatchError(frappe.ValidationError):
@@ -62,7 +61,7 @@
 	:param prefix: Naming series prefix gotten from Stock Settings
 	:return: The derived key. If no prefix is given, an empty string is returned
 	"""
-	if not text_type(prefix):
+	if not str(prefix):
 		return ''
 	else:
 		return prefix.upper() + '.#####'
diff --git a/erpnext/stock/doctype/batch/batch_dashboard.py b/erpnext/stock/doctype/batch/batch_dashboard.py
index afa0fca..725365b 100644
--- a/erpnext/stock/doctype/batch/batch_dashboard.py
+++ b/erpnext/stock/doctype/batch/batch_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
index 61d8de4..ca61a36 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py
index b0f1bbc..e16f5bb 100644
--- a/erpnext/stock/doctype/item/item_dashboard.py
+++ b/erpnext/stock/doctype/item/item_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index a9ee4b0..d717c50 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -11,7 +11,6 @@
 from frappe import _, msgprint
 from frappe.model.mapper import get_mapped_doc
 from frappe.utils import cstr, flt, get_link_to_form, getdate, new_line_sep, nowdate
-from six import string_types
 
 from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items
 from erpnext.controllers.buying_controller import BuyingController
@@ -274,7 +273,7 @@
 def make_purchase_order(source_name, target_doc=None, args=None):
 	if args is None:
 		args = {}
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	def postprocess(source, target_doc):
diff --git a/erpnext/stock/doctype/material_request/material_request_dashboard.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py
index 9133859..c1ce0a9 100644
--- a/erpnext/stock/doctype/material_request/material_request_dashboard.py
+++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py
index b798754..5484a11 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.py
+++ b/erpnext/stock/doctype/pick_list/pick_list.py
@@ -9,7 +9,6 @@
 from frappe.model.document import Document
 from frappe.model.mapper import map_child_doc
 from frappe.utils import cint, floor, flt, today
-from six import iteritems
 
 from erpnext.selling.doctype.sales_order.sales_order import (
 	make_delivery_note as create_delivery_note_from_sales_order,
@@ -246,7 +245,7 @@
 		warehouse_serial_nos_map.setdefault(warehouse, []).append(serial_no)
 
 	locations = []
-	for warehouse, serial_nos in iteritems(warehouse_serial_nos_map):
+	for warehouse, serial_nos in warehouse_serial_nos_map.items():
 		locations.append({
 			'qty': len(serial_nos),
 			'warehouse': warehouse,
diff --git a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py
index d19bede..ec3047e 100644
--- a/erpnext/stock/doctype/pick_list/pick_list_dashboard.py
+++ b/erpnext/stock/doctype/pick_list/pick_list_dashboard.py
@@ -1,5 +1,3 @@
-
-
 def get_data():
 	return {
 		'fieldname': 'pick_list',
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index 954e47d..762f45f 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -7,7 +7,6 @@
 from frappe.desk.notifications import clear_doctype_notifications
 from frappe.model.mapper import get_mapped_doc
 from frappe.utils import cint, flt, getdate, nowdate
-from six import iteritems
 
 from erpnext.accounts.utils import get_account_currency
 from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_enabled
@@ -358,7 +357,7 @@
 
 					# Amount added through landed-cos-voucher
 					if d.landed_cost_voucher_amount and landed_cost_entries:
-						for account, amount in iteritems(landed_cost_entries[(d.item_code, d.name)]):
+						for account, amount in landed_cost_entries[(d.item_code, d.name)].items():
 							account_currency = get_account_currency(account)
 							credit_amount = (flt(amount["base_amount"]) if (amount["base_amount"] or
 								account_currency!=self.company_currency) else flt(amount["amount"]))
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
index 18da88c..bdc5435 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index a488352..102730b 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -7,7 +7,6 @@
 
 import frappe
 from frappe.utils import add_days, cint, cstr, flt, today
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.doctype.account.test_account import get_inventory_account
@@ -486,7 +485,7 @@
 	def test_purchase_return_for_serialized_items(self):
 		def _check_serial_no_values(serial_no, field_values):
 			serial_no = frappe.get_doc("Serial No", serial_no)
-			for field, value in iteritems(field_values):
+			for field, value in field_values.items():
 				self.assertEqual(cstr(serial_no.get(field)), value)
 
 		from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
diff --git a/erpnext/stock/doctype/putaway_rule/putaway_rule.py b/erpnext/stock/doctype/putaway_rule/putaway_rule.py
index 25330b7..523ba12 100644
--- a/erpnext/stock/doctype/putaway_rule/putaway_rule.py
+++ b/erpnext/stock/doctype/putaway_rule/putaway_rule.py
@@ -10,7 +10,6 @@
 from frappe import _
 from frappe.model.document import Document
 from frappe.utils import cint, floor, flt, nowdate
-from six import string_types
 
 from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
 from erpnext.stock.utils import get_stock_balance
@@ -75,7 +74,7 @@
 		purpose: Purpose of Stock Entry
 		sync (optional): Sync with client side only for client side calls
 	"""
-	if isinstance(items, string_types):
+	if isinstance(items, str):
 		items = json.loads(items)
 
 	items_not_accomodated, updated_table = [], []
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 8f41c9d..d9d1957 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -8,8 +8,6 @@
 from frappe import ValidationError, _
 from frappe.model.naming import make_autoname
 from frappe.utils import add_days, cint, cstr, flt, get_link_to_form, getdate, nowdate
-from six import string_types
-from six.moves import map
 
 from erpnext.controllers.stock_controller import StockController
 from erpnext.stock.get_item_details import get_reserved_qty_for_so
@@ -590,7 +588,7 @@
 
 @frappe.whitelist()
 def get_pos_reserved_serial_nos(filters):
-	if isinstance(filters, string_types):
+	if isinstance(filters, str):
 		filters = json.loads(filters)
 
 	pos_transacted_sr_nos = frappe.db.sql("""select item.serial_no as serial_no
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 882b8df..fa2436b 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -9,7 +9,6 @@
 from frappe import _
 from frappe.model.mapper import get_mapped_doc
 from frappe.utils import cint, comma_or, cstr, flt, format_time, formatdate, getdate, nowdate
-from six import iteritems, itervalues, string_types
 
 import erpnext
 from erpnext.accounts.general_ledger import process_gl_map
@@ -287,7 +286,7 @@
 				if d.is_finished_item or d.is_process_loss:
 					item_wise_qty.setdefault(d.item_code, []).append(d.qty)
 
-		for item_code, qty_list in iteritems(item_wise_qty):
+		for item_code, qty_list in item_wise_qty.items():
 			total = flt(sum(qty_list), frappe.get_precision("Stock Entry Detail", "qty"))
 			if self.fg_completed_qty != total:
 				frappe.throw(_("The finished product {0} quantity {1} and For Quantity {2} cannot be different")
@@ -845,7 +844,7 @@
 
 		if item_account_wise_additional_cost:
 			for d in self.get("items"):
-				for account, amount in iteritems(item_account_wise_additional_cost.get((d.item_code, d.name), {})):
+				for account, amount in item_account_wise_additional_cost.get((d.item_code, d.name), {}).items():
 					if not amount: continue
 
 					gl_entries.append(self.get_gl_dict({
@@ -1017,7 +1016,7 @@
 				if self.work_order and self.purpose == "Material Transfer for Manufacture":
 					item_dict = self.get_pending_raw_materials(backflush_based_on)
 					if self.to_warehouse and self.pro_doc:
-						for item in itervalues(item_dict):
+						for item in item_dict.values():
 							item["to_warehouse"] = self.pro_doc.wip_warehouse
 					self.add_to_stock_entry_detail(item_dict)
 
@@ -1048,7 +1047,7 @@
 							WHERE
 								po.name = poitemsup.parent and po.name = %s """,self.purchase_order))
 
-					for item in itervalues(item_dict):
+					for item in item_dict.values():
 						if self.pro_doc and cint(self.pro_doc.from_wip_warehouse):
 							item["from_warehouse"] = self.pro_doc.wip_warehouse
 						#Get Reserve Warehouse from PO
@@ -1077,7 +1076,7 @@
 	def set_scrap_items(self):
 		if self.purpose != "Send to Subcontractor" and self.purpose in ["Manufacture", "Repack"]:
 			scrap_item_dict = self.get_bom_scrap_material(self.fg_completed_qty)
-			for item in itervalues(scrap_item_dict):
+			for item in scrap_item_dict.values():
 				item.idx = ''
 				if self.pro_doc and self.pro_doc.scrap_warehouse:
 					item["to_warehouse"] = self.pro_doc.scrap_warehouse
@@ -1181,7 +1180,7 @@
 			fetch_exploded = self.use_multi_level_bom, fetch_qty_in_stock_uom=False)
 
 		used_alternative_items = get_used_alternative_items(work_order = self.work_order)
-		for item in itervalues(item_dict):
+		for item in item_dict.values():
 			# if source warehouse presents in BOM set from_warehouse as bom source_warehouse
 			if item["allow_alternative_item"]:
 				item["allow_alternative_item"] = frappe.db.get_value('Work Order',
@@ -1206,7 +1205,7 @@
 		item_dict = get_bom_items_as_dict(self.bom_no, self.company, qty=qty,
 			fetch_exploded = 0, fetch_scrap_items = 1) or {}
 
-		for item in itervalues(item_dict):
+		for item in item_dict.values():
 			item.from_warehouse = ""
 			item.is_scrap_item = 1
 
@@ -1437,7 +1436,7 @@
 		if transfer_limit_qty >= to_transfer_qty:
 			allow_overproduction = True
 
-		for item, item_details in iteritems(item_dict):
+		for item, item_details in item_dict.items():
 			pending_to_issue = flt(item_details.required_qty) - flt(item_details.transferred_qty)
 			desire_to_transfer = flt(self.fg_completed_qty) * flt(item_details.required_qty) / max_qty
 
@@ -1747,7 +1746,7 @@
 
 @frappe.whitelist()
 def move_sample_to_retention_warehouse(company, items):
-	if isinstance(items, string_types):
+	if isinstance(items, str):
 		items = json.loads(items)
 	retention_warehouse = frappe.db.get_single_value('Stock Settings', 'sample_retention_warehouse')
 	stock_entry = frappe.new_doc("Stock Entry")
@@ -1933,7 +1932,7 @@
 
 @frappe.whitelist()
 def get_warehouse_details(args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	args = frappe._dict(args)
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
index 5832fe4..17266ad 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
@@ -4,7 +4,6 @@
 
 import frappe
 from frappe.utils import cint, flt
-from six import string_types
 
 import erpnext
 
@@ -60,7 +59,7 @@
 	if args.apply_putaway_rule:
 		s.apply_putaway_rule = args.apply_putaway_rule
 
-	if isinstance(args.qty, string_types):
+	if isinstance(args.qty, str):
 		if '.' in args.qty:
 			args.qty = flt(args.qty)
 		else:
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index d5d40c1..0679467 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe.permissions import add_user_permission, remove_user_permission
 from frappe.utils import flt, nowdate, nowtime
-from six import iteritems
 
 from erpnext.accounts.doctype.account.test_account import get_inventory_account
 from erpnext.stock.doctype.item.test_item import (
@@ -30,7 +29,7 @@
 
 def get_sle(**args):
 	condition, values = "", []
-	for key, value in iteritems(args):
+	for key, value in args.items():
 		condition += " and " if condition else " where "
 		condition += "`{0}`=%s".format(key)
 		values.append(value)
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index 9f0af49..93bca7a 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -1,4 +1,3 @@
-
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 6de04c4..438d3eb 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -8,7 +8,6 @@
 from frappe import _, throw
 from frappe.model.meta import get_field_precision
 from frappe.utils import add_days, add_months, cint, cstr, flt, getdate
-from six import iteritems, string_types
 
 from erpnext import get_company_currency
 from erpnext.accounts.doctype.pricing_rule.pricing_rule import (
@@ -58,7 +57,7 @@
 
 	out = get_basic_details(args, item, overwrite_warehouse)
 
-	if isinstance(doc, string_types):
+	if isinstance(doc, str):
 		doc = json.loads(doc)
 
 	if doc and doc.get('doctype') == 'Purchase Invoice':
@@ -97,7 +96,7 @@
 		out.update(bin_details)
 
 	# update args with out, if key or value not exists
-	for key, value in iteritems(out):
+	for key, value in out.items():
 		if args.get(key) is None:
 			args[key] = value
 
@@ -162,7 +161,7 @@
 
 
 def process_args(args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	args = frappe._dict(args)
@@ -179,7 +178,7 @@
 	return args
 
 def process_string_args(args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 	return args
 
@@ -1173,7 +1172,7 @@
 @frappe.whitelist()
 def get_serial_no(args, serial_nos=None, sales_order=None):
 	serial_no = None
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 		args = frappe._dict(args)
 	if args.get('doctype') == 'Sales Invoice' and not args.get('update_stock'):
@@ -1202,7 +1201,7 @@
 
 @frappe.whitelist()
 def get_blanket_order_details(args):
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = frappe._dict(json.loads(args))
 
 	blanket_order_details = None
diff --git a/erpnext/stock/report/bom_search/bom_search.py b/erpnext/stock/report/bom_search/bom_search.py
index 960396d..a22b224 100644
--- a/erpnext/stock/report/bom_search/bom_search.py
+++ b/erpnext/stock/report/bom_search/bom_search.py
@@ -3,7 +3,6 @@
 
 
 import frappe
-from six import iteritems
 
 
 def execute(filters=None):
@@ -20,9 +19,9 @@
 		for d in frappe.get_all(doctype, fields=["parent", "item_code"]):
 			all_boms.setdefault(d.parent, []).append(d.item_code)
 
-		for parent, items in iteritems(all_boms):
+		for parent, items in all_boms.items():
 			valid = True
-			for key, item in iteritems(filters):
+			for key, item in filters.items():
 				if key != "search_sub_assemblies":
 					if item and item not in items:
 						valid = False
diff --git a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py
index cf27326..a381820 100644
--- a/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py
+++ b/erpnext/stock/report/incorrect_balance_qty_after_transaction/incorrect_balance_qty_after_transaction.py
@@ -4,7 +4,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 
 def execute(filters=None):
@@ -26,7 +25,7 @@
 
 def validate_data(itewise_balance_qty):
 	res = []
-	for key, data in iteritems(itewise_balance_qty):
+	for key, data in itewise_balance_qty.items():
 		row = get_incorrect_data(data)
 		if row:
 			res.append(row)
diff --git a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py
index 5f03c7c..d452ffd 100644
--- a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py
+++ b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.py
@@ -5,7 +5,6 @@
 
 import frappe
 from frappe import _
-from six import iteritems
 
 from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
 
@@ -43,7 +42,7 @@
 
 	total_value = frappe._dict({'qty': 0, 'valuation_rate': 0, 'serial_no': frappe.bold(_('Balance'))})
 
-	for serial_no, data in iteritems(serial_nos_data):
+	for serial_no, data in serial_nos_data.items():
 		total_dict = frappe._dict({'qty': 0, 'valuation_rate': 0, 'serial_no': frappe.bold(_('Total'))})
 
 		if check_incorrect_serial_data(data, total_dict):
diff --git a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py
index 7cce4a7..28e6cb2 100644
--- a/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py
+++ b/erpnext/stock/report/incorrect_stock_value_report/incorrect_stock_value_report.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import add_days, getdate, today
-from six import iteritems
 
 import erpnext
 from erpnext.accounts.utils import get_stock_and_account_balance
@@ -66,7 +65,7 @@
 		voucher_wise_dict.setdefault((d.item_code, d.warehouse), []).append(d)
 
 	closing_date = add_days(from_date, -1)
-	for key, stock_data in iteritems(voucher_wise_dict):
+	for key, stock_data in voucher_wise_dict.items():
 		prev_stock_value = get_stock_value_on(posting_date = closing_date, item_code=key[0], warehouse =key[1])
 		for data in stock_data:
 			expected_stock_value = prev_stock_value + data.stock_value_difference
diff --git a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
index 3c4dbce..d9adced 100644
--- a/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
+++ b/erpnext/stock/report/product_bundle_balance/product_bundle_balance.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 from erpnext.stock.report.stock_ledger.stock_ledger import get_item_group_condition
 
@@ -26,11 +25,11 @@
 		warehouse_company_map = {}
 		for child_item in required_items:
 			child_item_balance = stock_balance.get(child_item.item_code, frappe._dict())
-			for warehouse, sle in iteritems(child_item_balance):
+			for warehouse, sle in child_item_balance.items():
 				if flt(sle.qty_after_transaction) > 0:
 					warehouse_company_map[warehouse] = sle.company
 
-		for warehouse, company in iteritems(warehouse_company_map):
+		for warehouse, company in warehouse_company_map.items():
 			parent_row = {
 				"indent": 0,
 				"item_code": parent_item,
diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.py b/erpnext/stock/report/stock_ageing/stock_ageing.py
index 1209be2..0ebe4f9 100644
--- a/erpnext/stock/report/stock_ageing/stock_ageing.py
+++ b/erpnext/stock/report/stock_ageing/stock_ageing.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cint, date_diff, flt
-from six import iteritems
 
 from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
 
@@ -19,7 +18,7 @@
 	_func = itemgetter(1)
 
 	data = []
-	for item, item_dict in iteritems(item_details):
+	for item, item_dict in item_details.items():
 		earliest_age, latest_age = 0, 0
 
 		fifo_queue = sorted(filter(_func, item_dict["fifo_queue"]), key=_func)
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index 963c448..c0b89fd 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cint, date_diff, flt, getdate
-from six import iteritems
 
 import erpnext
 from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue
@@ -228,7 +227,7 @@
 		qty_dict = iwb_map[(company, item, warehouse)]
 
 		no_transactions = True
-		for key, val in iteritems(qty_dict):
+		for key, val in qty_dict.items():
 			val = flt(val, float_precision)
 			qty_dict[key] = val
 			if key != "val_rate" and val:
@@ -285,7 +284,7 @@
 
 	if filters.get('show_variant_attributes', 0) == 1:
 		variant_values = get_variant_values_for(list(item_details))
-		item_details = {k: v.update(variant_values.get(k, {})) for k, v in iteritems(item_details)}
+		item_details = {k: v.update(variant_values.get(k, {})) for k, v in item_details.items()}
 
 	return item_details
 
diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
index 11559aa..d1748ed 100644
--- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
+++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 
 def execute(filters=None):
@@ -15,7 +14,7 @@
 	material_transfer_vouchers = get_material_transfer_vouchers()
 	data = []
 
-	for item_code, suppliers in iteritems(supplier_details):
+	for item_code, suppliers in supplier_details.items():
 		consumed_qty = consumed_amount = delivered_qty = delivered_amount = 0.0
 		total_qty = total_amount = 0.0
 		if consumed_details.get(item_code):
@@ -96,7 +95,7 @@
 
 	if supplier:
 		invalid_items = []
-		for item_code, suppliers in iteritems(item_supplier_map):
+		for item_code, suppliers in item_supplier_map.items():
 			if supplier not in suppliers:
 				invalid_items.append(item_code)
 
diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
index b43921f..d3af5f6 100644
--- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
+++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
@@ -8,7 +8,6 @@
 import frappe
 from frappe import _
 from frappe.utils import flt
-from six import iteritems
 
 from erpnext.stock.report.stock_ageing.stock_ageing import get_average_age, get_fifo_queue
 from erpnext.stock.report.stock_balance.stock_balance import (
@@ -56,7 +55,7 @@
 
 
 	# sum bal_qty by item
-	for (item, item_group), wh_balance in iteritems(item_balance):
+	for (item, item_group), wh_balance in item_balance.items():
 		if not item_ageing.get(item):  continue
 
 		total_stock_value = sum(item_value[(item, item_group)])
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index f694da0..9c4c676 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -8,7 +8,6 @@
 from frappe import _
 from frappe.model.meta import get_field_precision
 from frappe.utils import cint, cstr, flt, get_link_to_form, getdate, now
-from six import iteritems
 
 import erpnext
 from erpnext.stock.utils import (
@@ -152,7 +151,7 @@
 		distinct_item_warehouses[(args[i].get('item_code'), args[i].get('warehouse'))].reposting_status = True
 
 		if obj.new_items_found:
-			for item_wh, data in iteritems(distinct_item_warehouses):
+			for item_wh, data in distinct_item_warehouses.items():
 				if ('args_idx' not in data and not data.reposting_status) or (data.sle_changed and data.reposting_status):
 					data.args_idx = len(args)
 					args.append(data.sle)
@@ -430,7 +429,7 @@
 				else:
 					self.get_fifo_values(sle)
 					self.wh_data.qty_after_transaction += flt(sle.actual_qty)
-					self.wh_data.stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in self.wh_data.stock_queue))
+					self.wh_data.stock_value = sum(flt(batch[0]) * flt(batch[1]) for batch in self.wh_data.stock_queue)
 
 		# rounding as per precision
 		self.wh_data.stock_value = flt(self.wh_data.stock_value, self.precision)
@@ -715,8 +714,8 @@
 
 					# If no entry found with outgoing rate, collapse stack
 					if index is None:  # nosemgrep
-						new_stock_value = sum((d[0]*d[1] for d in self.wh_data.stock_queue)) - qty_to_pop*outgoing_rate
-						new_stock_qty = sum((d[0] for d in self.wh_data.stock_queue)) - qty_to_pop
+						new_stock_value = sum(d[0]*d[1] for d in self.wh_data.stock_queue) - qty_to_pop*outgoing_rate
+						new_stock_qty = sum(d[0] for d in self.wh_data.stock_queue) - qty_to_pop
 						self.wh_data.stock_queue = [[new_stock_qty, new_stock_value/new_stock_qty if new_stock_qty > 0 else outgoing_rate]]
 						break
 				else:
@@ -740,8 +739,8 @@
 					batch[0] = batch[0] - qty_to_pop
 					qty_to_pop = 0
 
-		stock_value = _round_off_if_near_zero(sum((flt(batch[0]) * flt(batch[1]) for batch in self.wh_data.stock_queue)))
-		stock_qty = _round_off_if_near_zero(sum((flt(batch[0]) for batch in self.wh_data.stock_queue)))
+		stock_value = _round_off_if_near_zero(sum(flt(batch[0]) * flt(batch[1]) for batch in self.wh_data.stock_queue))
+		stock_qty = _round_off_if_near_zero(sum(flt(batch[0]) for batch in self.wh_data.stock_queue))
 
 		if stock_qty:
 			self.wh_data.valuation_rate = stock_value / flt(stock_qty)
@@ -774,7 +773,7 @@
 
 	def raise_exceptions(self):
 		msg_list = []
-		for warehouse, exceptions in iteritems(self.exceptions):
+		for warehouse, exceptions in self.exceptions.items():
 			deficiency = min(e["diff"] for e in exceptions)
 
 			if ((exceptions[0]["voucher_type"], exceptions[0]["voucher_no"]) in
@@ -802,7 +801,7 @@
 
 	def update_bin(self):
 		# update bin for each warehouse
-		for warehouse, data in iteritems(self.data):
+		for warehouse, data in self.data.items():
 			bin_record = get_or_make_bin(self.item_code, warehouse)
 
 			frappe.db.set_value('Bin', bin_record, {
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 5aafecf..8031c58 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _
 from frappe.utils import cstr, flt, get_link_to_form, nowdate, nowtime
-from six import string_types
 
 import erpnext
 
@@ -216,7 +215,7 @@
 def get_incoming_rate(args, raise_error_if_no_rate=True):
 	"""Get Incoming Rate based on valuation method"""
 	from erpnext.stock.stock_ledger import get_previous_sle, get_valuation_rate
-	if isinstance(args, string_types):
+	if isinstance(args, str):
 		args = json.loads(args)
 
 	in_rate = 0
diff --git a/erpnext/support/__init__.py b/erpnext/support/__init__.py
index b9a7c1e..ac23ede 100644
--- a/erpnext/support/__init__.py
+++ b/erpnext/support/__init__.py
@@ -1,4 +1,3 @@
-
 install_docs = [
 	{'doctype':'Role', 'role_name':'Support Team', 'name':'Support Team'},
 	{'doctype':'Role', 'role_name':'Maintenance User', 'name':'Maintenance User'},
diff --git a/erpnext/support/doctype/issue/issue_dashboard.py b/erpnext/support/doctype/issue/issue_dashboard.py
index e2de992..7ab358a 100644
--- a/erpnext/support/doctype/issue/issue_dashboard.py
+++ b/erpnext/support/doctype/issue/issue_dashboard.py
@@ -1,4 +1,3 @@
-
 from frappe import _
 
 
diff --git a/erpnext/support/report/issue_analytics/issue_analytics.py b/erpnext/support/report/issue_analytics/issue_analytics.py
index 543a34c..056f2e0 100644
--- a/erpnext/support/report/issue_analytics/issue_analytics.py
+++ b/erpnext/support/report/issue_analytics/issue_analytics.py
@@ -7,7 +7,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
 
@@ -170,7 +169,7 @@
 		self.data = []
 		self.get_periodic_data()
 
-		for entity, period_data in iteritems(self.issue_periodic_data):
+		for entity, period_data in self.issue_periodic_data.items():
 			if self.filters.based_on == 'Customer':
 				row = {'customer': entity}
 			elif self.filters.based_on == 'Assigned To':
diff --git a/erpnext/support/report/issue_analytics/test_issue_analytics.py b/erpnext/support/report/issue_analytics/test_issue_analytics.py
index b27dc46..ba4dc54 100644
--- a/erpnext/support/report/issue_analytics/test_issue_analytics.py
+++ b/erpnext/support/report/issue_analytics/test_issue_analytics.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/support/report/issue_summary/issue_summary.py b/erpnext/support/report/issue_summary/issue_summary.py
index b5d5227..39a5c40 100644
--- a/erpnext/support/report/issue_summary/issue_summary.py
+++ b/erpnext/support/report/issue_summary/issue_summary.py
@@ -7,7 +7,6 @@
 import frappe
 from frappe import _, scrub
 from frappe.utils import flt
-from six import iteritems
 
 
 def execute(filters=None):
@@ -141,7 +140,7 @@
 		self.data = []
 		self.get_summary_data()
 
-		for entity, data in iteritems(self.issue_summary_data):
+		for entity, data in self.issue_summary_data.items():
 			if self.filters.based_on == 'Customer':
 				row = {'customer': entity}
 			elif self.filters.based_on == 'Assigned To':
diff --git a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
index e3a7e5f..6b2098f 100644
--- a/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
+++ b/erpnext/support/report/support_hour_distribution/support_hour_distribution.py
@@ -5,7 +5,6 @@
 import frappe
 from frappe import _
 from frappe.utils import add_to_date, get_datetime, getdate
-from six import iteritems
 
 time_slots = {
 	'12AM - 3AM': '00:00:00-03:00:00',
@@ -34,7 +33,7 @@
 	time_slot_wise_total_count = {}
 	while(start_date <= getdate(filters.to_date)):
 		hours_count = {'date': start_date}
-		for key, value in iteritems(time_slots):
+		for key, value in time_slots.items():
 			start_time, end_time = value.split('-')
 			start_time = get_datetime("{0} {1}".format(start_date.strftime("%Y-%m-%d"), start_time))
 			end_time = get_datetime("{0} {1}".format(start_date.strftime("%Y-%m-%d"), end_time))
diff --git a/erpnext/support/web_form/issues/issues.py b/erpnext/support/web_form/issues/issues.py
index 19b550f..02e3e93 100644
--- a/erpnext/support/web_form/issues/issues.py
+++ b/erpnext/support/web_form/issues/issues.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	pass
diff --git a/erpnext/templates/includes/salary_slip_log.html b/erpnext/templates/includes/salary_slip_log.html
index d36ee6e..22c62ce 100644
--- a/erpnext/templates/includes/salary_slip_log.html
+++ b/erpnext/templates/includes/salary_slip_log.html
@@ -10,7 +10,7 @@
 	<tbody>
 		{% for ss_dict in ss_list %}
 			<tr>
-			{% for key, value in ss_dict.iteritems()|sort %}
+			{% for key, value in ss_dict.items()|sort %}
 				<td {% if key == "Total Pay"%} align = "right" {% endif %}> {{value}} </td>
 			{% endfor %}
 			</tr>
diff --git a/erpnext/templates/pages/help.py b/erpnext/templates/pages/help.py
index 25e7c26..6a83fc8 100644
--- a/erpnext/templates/pages/help.py
+++ b/erpnext/templates/pages/help.py
@@ -1,4 +1,3 @@
-
 import json
 
 import frappe
diff --git a/erpnext/templates/pages/non_profit/join_chapter.py b/erpnext/templates/pages/non_profit/join_chapter.py
index a5d0347..7caf87d 100644
--- a/erpnext/templates/pages/non_profit/join_chapter.py
+++ b/erpnext/templates/pages/non_profit/join_chapter.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/templates/pages/non_profit/leave_chapter.py b/erpnext/templates/pages/non_profit/leave_chapter.py
index 6aa8758..65908e1 100644
--- a/erpnext/templates/pages/non_profit/leave_chapter.py
+++ b/erpnext/templates/pages/non_profit/leave_chapter.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/templates/pages/regional/india/update_gstin.py b/erpnext/templates/pages/regional/india/update_gstin.py
index b65f0a6..95b8f72 100644
--- a/erpnext/templates/pages/regional/india/update_gstin.py
+++ b/erpnext/templates/pages/regional/india/update_gstin.py
@@ -1,6 +1,4 @@
-
 import frappe
-from six import iteritems
 
 
 def get_context(context):
@@ -30,7 +28,7 @@
 
 def update_gstin(context):
 	dirty = False
-	for key, value in iteritems(frappe.form_dict):
+	for key, value in frappe.form_dict.items():
 		if key != 'party':
 			address_name = frappe.get_value('Address', key)
 			if address_name:
diff --git a/erpnext/templates/pages/search_help.py b/erpnext/templates/pages/search_help.py
index c8854d7..1ef3942 100644
--- a/erpnext/templates/pages/search_help.py
+++ b/erpnext/templates/pages/search_help.py
@@ -1,4 +1,3 @@
-
 import frappe
 import requests
 from frappe import _
@@ -6,7 +5,6 @@
 from frappe.utils.global_search import search
 from html2text import html2text
 from jinja2 import utils
-from six import text_type
 
 
 def get_context(context):
@@ -76,7 +74,7 @@
 	for topic in topics_data:
 		route = api.base_url + '/' + (api.post_route  + '/' if api.post_route else "")
 		for key in api.post_route_key_list.split(','):
-			route += text_type(topic[key])
+			route += str(topic[key])
 
 		results.append(frappe._dict({
 			'title': topic[api.post_title_key],
diff --git a/erpnext/templates/pages/task_info.py b/erpnext/templates/pages/task_info.py
index 1d809c4..d1a70e1 100644
--- a/erpnext/templates/pages/task_info.py
+++ b/erpnext/templates/pages/task_info.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/templates/pages/timelog_info.py b/erpnext/templates/pages/timelog_info.py
index 3bc7401..db61e7e 100644
--- a/erpnext/templates/pages/timelog_info.py
+++ b/erpnext/templates/pages/timelog_info.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 
diff --git a/erpnext/tests/test_init.py b/erpnext/tests/test_init.py
index 020133a..36a9bf5 100644
--- a/erpnext/tests/test_init.py
+++ b/erpnext/tests/test_init.py
@@ -1,8 +1,6 @@
-
 import unittest
 
 import frappe
-from six.moves import range
 
 from erpnext import encode_company_abbr
 
diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py
index b232d69..10d62ce 100644
--- a/erpnext/tests/test_regional.py
+++ b/erpnext/tests/test_regional.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/tests/test_search.py b/erpnext/tests/test_search.py
index 3594cfe..c169458 100644
--- a/erpnext/tests/test_search.py
+++ b/erpnext/tests/test_search.py
@@ -1,4 +1,3 @@
-
 import unittest
 
 import frappe
diff --git a/erpnext/tests/test_subcontracting.py b/erpnext/tests/test_subcontracting.py
index 170daa9..fccfd0d 100644
--- a/erpnext/tests/test_subcontracting.py
+++ b/erpnext/tests/test_subcontracting.py
@@ -1,4 +1,3 @@
-
 import copy
 import unittest
 from collections import defaultdict
diff --git a/erpnext/tests/test_woocommerce.py b/erpnext/tests/test_woocommerce.py
index 59a9a31..4a451ab 100644
--- a/erpnext/tests/test_woocommerce.py
+++ b/erpnext/tests/test_woocommerce.py
@@ -1,4 +1,3 @@
-
 import os
 import time
 import unittest
diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py
index 8ccda41..faf3fd4 100644
--- a/erpnext/utilities/activation.py
+++ b/erpnext/utilities/activation.py
@@ -4,7 +4,6 @@
 
 import frappe
 from frappe import _
-from six import iteritems
 
 import erpnext
 
@@ -45,7 +44,7 @@
 		"Work Order": 5
 	}
 
-	for doctype, min_count in iteritems(doctypes):
+	for doctype, min_count in doctypes.items():
 		count = frappe.db.count(doctype)
 		if count > min_count:
 			activation_level += 1
diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py
index 4e60513..ae13952 100644
--- a/erpnext/utilities/doctype/video/video.py
+++ b/erpnext/utilities/doctype/video/video.py
@@ -10,7 +10,6 @@
 from frappe import _
 from frappe.model.document import Document
 from pyyoutube import Api
-from six import string_types
 
 
 class Video(Document):
@@ -87,7 +86,7 @@
 		Returns video id from url
 		:param youtube url: String URL
 	"""
-	if not isinstance(url, string_types):
+	if not isinstance(url, str):
 		frappe.throw(_("URL can only be a string"), title=_("Invalid URL"))
 
 	pattern = re.compile(r'[a-z\:\//\.]+(youtube|youtu)\.(com|be)/(watch\?v=|embed/|.+\?v=)?([^"&?\s]{11})?')
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index a1c954b..14b3afa 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -6,7 +6,6 @@
 import frappe.share
 from frappe import _
 from frappe.utils import cint, cstr, flt, get_time, now_datetime
-from six import string_types
 
 from erpnext.controllers.status_updater import StatusUpdater
 
@@ -178,7 +177,7 @@
 		frappe.delete_doc("Event", events, for_reload=True)
 
 def validate_uom_is_integer(doc, uom_field, qty_fields, child_dt=None):
-	if isinstance(qty_fields, string_types):
+	if isinstance(qty_fields, str):
 		qty_fields = [qty_fields]
 
 	distinct_uoms = list(set(d.get(uom_field) for d in doc.get_all_children()))
diff --git a/erpnext/utilities/web_form/addresses/addresses.py b/erpnext/utilities/web_form/addresses/addresses.py
index 8024f87..db32552 100644
--- a/erpnext/utilities/web_form/addresses/addresses.py
+++ b/erpnext/utilities/web_form/addresses/addresses.py
@@ -1,5 +1,3 @@
-
-
 def get_context(context):
 	# do your magic here
 	context.show_sidebar = True
diff --git a/erpnext/www/lms/content.py b/erpnext/www/lms/content.py
index b4d9793..b187a78 100644
--- a/erpnext/www/lms/content.py
+++ b/erpnext/www/lms/content.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 import erpnext.education.utils as utils
diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py
index 6f1f0f2..012e25c 100644
--- a/erpnext/www/lms/course.py
+++ b/erpnext/www/lms/course.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 import erpnext.education.utils as utils
diff --git a/erpnext/www/lms/index.py b/erpnext/www/lms/index.py
index 97d474b..035f7d9 100644
--- a/erpnext/www/lms/index.py
+++ b/erpnext/www/lms/index.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 import erpnext.education.utils as utils
diff --git a/erpnext/www/lms/profile.py b/erpnext/www/lms/profile.py
index 5e51ddc..8cd2f24 100644
--- a/erpnext/www/lms/profile.py
+++ b/erpnext/www/lms/profile.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 import erpnext.education.utils as utils
diff --git a/erpnext/www/lms/program.py b/erpnext/www/lms/program.py
index a7c713c..db2653a 100644
--- a/erpnext/www/lms/program.py
+++ b/erpnext/www/lms/program.py
@@ -1,4 +1,3 @@
-
 import frappe
 from frappe import _
 
diff --git a/erpnext/www/lms/topic.py b/erpnext/www/lms/topic.py
index 684437c..17fc8f7 100644
--- a/erpnext/www/lms/topic.py
+++ b/erpnext/www/lms/topic.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 import erpnext.education.utils as utils
diff --git a/erpnext/www/payment_setup_certification.py b/erpnext/www/payment_setup_certification.py
index c87f468..c65cddb 100644
--- a/erpnext/www/payment_setup_certification.py
+++ b/erpnext/www/payment_setup_certification.py
@@ -1,4 +1,3 @@
-
 import frappe
 
 no_cache = 1
diff --git a/erpnext/www/support/index.py b/erpnext/www/support/index.py
index 1d198ed..408ddf4 100644
--- a/erpnext/www/support/index.py
+++ b/erpnext/www/support/index.py
@@ -1,4 +1,3 @@
-
 import frappe