diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index a431829080..9d99ebb7bb 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 3afa0ce7df..5df8269f75 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 3a5514388c..a8de06cc6c 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 os
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 @@ def create_charts(company, chart_template=None, existing_company=None, custom_ch
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 @@ def validate_bank_account(coa, bank_account):
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 @@ def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=Fals
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 7d94c89ad7..79001d7705 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 @@ from xml.etree import ElementTree as ET
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 get_account_types(root_list, csv_content, prefix=None):
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 eb90fc7a86..bf1e967bdb 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 e7ef6aa25f..36482aac96 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 bc08eab035..db4d7e51d5 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 c57e862892..e786d13c95 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.background_jobs import enqueue
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 @@ def write_xlsx(data, sheet_name, wb=None, column_widths=None, file_path=None):
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 6125c27cdf..cca8a88c30 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 json
import frappe
from frappe.utils import getdate
from frappe.utils.dateutils import parse_date
-from six import iteritems
@frappe.whitelist()
@@ -43,7 +42,7 @@ def create_bank_entries(columns, data, bank_account):
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 4465ec6024..6e7b687c04 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 0bae8fe145..f524803f64 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 02377cd565..5da0077a2b 100644
--- a/erpnext/accounts/doctype/dunning/dunning.py
+++ b/erpnext/accounts/doctype/dunning/dunning.py
@@ -6,7 +6,6 @@ import json
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 @@ def calculate_interest_and_amount(outstanding_amount, rate_of_interest, dunning_
@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 ebe4efb098..a891bd2917 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 0efe291d21..fe862507fb 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 4a56cd39d0..57b039d022 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 3ede25f19d..892a2c62cf 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 f184b95a92..9d1452b1b3 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.document import Document
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 @@ class GLEntry(Document):
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 771846e508..b748429302 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 71177c2531..af01c57560 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 9c7e93fa56..ca17265078 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -7,7 +7,6 @@ import json
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 @@ class JournalEntry(AccountsController):
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 @@ class JournalEntry(AccountsController):
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 @@ class JournalEntry(AccountsController):
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 @@ def get_outstanding(args):
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 7652e9691b..25328e501e 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 3e6575f254..96008c4733 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 d6f594d5bc..26fd16a4fd 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -7,7 +7,6 @@ import json
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 @@ class PaymentEntry(AccountsController):
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 @@ class PaymentEntry(AccountsController):
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 @@ class PaymentEntry(AccountsController):
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 @@ def validate_inclusive_tax(tax, doc):
@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 bb0fc975ca..3996892241 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 02da979389..37bbaec33d 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 7f5b96c8a8..ac80b794ba 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 aa5de2ca3f..2cf7a6cf7a 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 814372f6b3..0d6404c324 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 @@ class POSInvoice(SalesInvoice):
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_sales_return(source_name, target_doc=None):
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 02a0b26627..843497019d 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 unconsolidate_pos_invoices(closing_entry):
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 d80c1b27cc..1d49c3df14 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py
@@ -6,7 +6,6 @@ import frappe
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 @@ class POSProfile(Document):
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 23606cec53..ac96b045a2 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -11,7 +11,6 @@ import frappe
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 @@ def apply_pricing_rule(args, doc=None):
}
"""
- if isinstance(args, string_types):
+ if isinstance(args, str):
args = json.loads(args)
args = frappe._dict(args)
@@ -234,7 +233,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
get_product_discount_rule,
)
- if isinstance(doc, string_types):
+ if isinstance(doc, str):
doc = json.loads(doc)
if doc:
@@ -270,7 +269,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
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 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None):
@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 984d65be6f..62e3dc8346 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -6,7 +6,6 @@ import frappe
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 @@ class PurchaseInvoice(BuyingController):
# 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 f1878b480e..76c9fcdd7c 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 95a7a1c889..3176556ec5 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 e77c4e1683..cd270f505e 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -18,7 +18,6 @@ from frappe.utils import (
getdate,
nowdate,
)
-from six import iteritems
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
@@ -533,7 +532,7 @@ class SalesInvoice(SellingController):
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 @@ class SalesInvoice(SellingController):
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 104d4f9b8a..5cdc8dae25 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 e98ff3f528..969756addf 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 @@ import frappe
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 @@ class TestSalesInvoice(unittest.TestCase):
# 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 @@ class TestSalesInvoice(unittest.TestCase):
# 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 5b9fbafed8..bc1fd8ec32 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 fdb417ed6d..d5551d1247 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 44d5ec684f..c01ac23f1e 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 ef2a053227..fc70621159 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 68d980257e..63b714e68c 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 15df62daa2..d076e39964 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 c9d52da78a..4bdb70a480 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 b0d6983e6e..a16377c847 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.contacts.doctype.address.address import get_default_address
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 @@ def get_tax_template(posting_date, args):
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 44344bb763..d5ac9b20c5 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 @@ from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity
test_records = frappe.get_test_records('Tax Rule')
-from six import iteritems
class TestTaxRule(unittest.TestCase):
@@ -175,7 +174,7 @@ def make_tax_rule(**args):
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 31dcb406d8..dc1818a052 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 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
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 46d0c2e487..256d4ac217 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 19b550feea..02e3e93333 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 26ff2c6e04..2108bc158d 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -26,7 +26,6 @@ from frappe.utils import (
getdate,
nowdate,
)
-from six import iteritems
import erpnext
from erpnext import get_company_currency
@@ -508,7 +507,7 @@ def get_timeline_data(doctype, name):
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 50b1a679b6..73370e4ed6 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 b5408bd4c8..ab95c93e36 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 a95bcf83ef..3c94629203 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 @@ class AccountsReceivableSummary(ReceivablePayableReport):
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 ead6776678..3bb590a564 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 datetime
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 @@ def execute(filters=None):
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 75365b81f2..15041f2516 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 add_total_row_account(out, data, label, period_list, currency, summary_data,
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 2954619846..56db841e94 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 @@ class PartyLedgerSummaryReport(object):
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 @@ class PartyLedgerSummaryReport(object):
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 @@ class PartyLedgerSummaryReport(object):
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 @@ class PartyLedgerSummaryReport(object):
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 c69bb3f70c..d547470bf3 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 set_gl_entries_by_account(dimension_items_list, filters, account, gl_entries
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 37ff103e72..4bb44b398b 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 re
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 get_appropriate_currency(company, filters=None):
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 f538764873..050403d21e 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -7,7 +7,6 @@ from collections import OrderedDict
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 @@ def get_data_with_opening_closing(filters, account_details, accounting_dimension
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 7292f2bde2..bf668ab779 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 d576c273a2..07f2e435e4 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 89cc0a8c8c..c38e4b8c7f 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 4aca40cf6c..effc913da0 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 4340840df0..39e84e3cef 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -9,7 +9,6 @@ import frappe.defaults
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 @@ def get_children(doctype, parent, company, is_root=False):
@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 772ed61137..37cdbb2df5 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 cfe7edca71..c0c437f8d2 100644
--- a/erpnext/assets/doctype/asset/asset.py
+++ b/erpnext/assets/doctype/asset/asset.py
@@ -20,7 +20,6 @@ from frappe.utils import (
nowdate,
today,
)
-from six import string_types
import erpnext
from erpnext.accounts.general_ledger import make_reverse_gl_entries
@@ -625,7 +624,7 @@ class Asset(AccountsController):
@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_journal_entry(asset_name):
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 c9efe3d084..00d08473d6 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 8588c002d5..0163595b51 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 b670bd58d4..2db750e75c 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.model.mapper import get_mapped_doc
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 @@ def make_supplier_quotation_from_rfq(source_name, target_doc=None, for_supplier=
# 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 21ef33294e..dc1cda126a 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 cfa0375e2e..78efd8eea0 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 1680efc53c..236b91ad58 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 e021c9c6be..5d693263f8 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 3ead3ef957..d718a94252 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 168dead9bf..f4675e749a 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 1b85871cf9..e0551a4ca8 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -20,7 +20,6 @@ from frappe.utils import (
nowdate,
today,
)
-from six import text_type
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -1080,7 +1079,7 @@ class AccountsController(TransactionBase):
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 @@ def get_payment_terms(terms_template, posting_date=None, grand_total=None, base_
@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 2d6510854e..2bad6f8e9f 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -8,7 +8,6 @@ import json
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 @@ def get_variant(template, args=None, variant=None, manufacturer=None,
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 @@ def make_variant_based_on_manufacturer(template, manufacturer, manufacturer_part
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 @@ def find_variant(template, args, variant_item_code=None):
@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 @@ def create_variant(item, args):
@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 enqueue_multiple_variant_creation(item, args):
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 aac72ab10e..667edab06a 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -176,7 +176,7 @@ class calculate_taxes_and_totals(object):
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 391b5ec881..5c6e06a7d7 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 @@ class TestItemVariant(unittest.TestCase):
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 0d8789abef..e75587607e 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 226778db01..49b844bf7e 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 8adbb4e25e..7439e4c917 100644
--- a/erpnext/crm/doctype/contract_template/contract_template.py
+++ b/erpnext/crm/doctype/contract_template/contract_template.py
@@ -7,7 +7,6 @@ import json
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 @@ class ContractTemplate(Document):
@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 37e28e0e1a..017390dc83 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 5d42482c02..708fb12f1a 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 0da0e0e71a..9b56170da3 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 4cff13f232..f53b5bde9e 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 frappe
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 @@ class OpportunitySummaryBySalesStage(object):
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 @@ class OpportunitySummaryBySalesStage(object):
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 7466982d92..1c7846b120 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 @@ import pandas
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 @@ class SalesPipelineAnalytics(object):
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 @@ class SalesPipelineAnalytics(object):
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 e1bf8d0fdd..4a18a99f41 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 89bd9ab34a..5fa181dfa4 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 ec6d2810b7..fe1a1fb203 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 @@ def setup_item_price():
}
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 3d2c8b6e82..0469264da1 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 @@ def setup_item_price():
}
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 1ce995a3a9..7137c6ef56 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 f0ac173a4a..273a3f92f3 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 270333c1d2..47519c1664 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 0e66ec0405..72cd420550 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 3d1a013956..f84a853a79 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 de27a7a2c2..e5414a9c09 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 68ac0c3ec5..020ab3b83b 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 d0e597e7b7..11ea9b4022 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 5d2a22597e..09b98c288b 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 0cd51cf792..96ce1945a4 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 22f05c9e7d..d9fc5e5df0 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 17578d7ddc..07b2e2781e 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 39a554f29d..6035afbcf0 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 cf8efde7df..56c2b29fde 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 97f581a1e0..c686b09b9e 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 3615fd1c37..ede2411dc3 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 335b6d28d0..ffd323d3d2 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 44313f2bbc..b8ae8b08a9 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 81bb30b1da..14ed95d48c 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 efd5dc9104..3ae772dd90 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 62407bef02..5dae9f6ee7 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 9754799204..6758452969 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 be1e005491..ebb639e46e 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 fca5ad6ed5..d01790d645 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 19b550feea..02e3e93333 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 fdeb32da7a..f5f9ce3b16 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 d7ebf59ea8..1d0dfa5c69 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 7dd0c8658d..212f81b5f9 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 7feca83e0f..66826ba8d7 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 @@ def get_products_details():
#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 57c43675ff..b52c3fc2a8 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 cfd2a7ce04..8d6f13a77e 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 bc8ef820e9..2a277ee035 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 f52e2b027c..116a3f9118 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 f466534d2c..4bb36a0d7f 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 b23e0fd93a..91970575a1 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 38e1f54ba9..fe11c47e60 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 email_reply_parser import EmailReplyParser
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 @@ def get_user_emails_from_group(group):
: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 306f43a418..ed98168aef 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 0aaff52ee2..a4c0af0a4b 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 089bd2c1b5..9450258a8a 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 1dd6ad3b15..6825dae250 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 48f2c1d270..3b846a0e40 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 4e1780b997..eaa42c7b4c 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_job_applicant(source_name, target_doc=None):
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 1733ac9726..07c2402e1a 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 f165d0a0eb..6e2a83eaa7 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 44052cc8e6..7539c7165d 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 e074e266b8..4a540ce610 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 f5312476a2..4bb003ded1 100644
--- a/erpnext/hr/doctype/interview/interview.py
+++ b/erpnext/hr/doctype/interview/interview.py
@@ -190,9 +190,8 @@ def get_expected_skill_set(interview_round):
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 @@ def get_events(start, end, filters=None):
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 f0b470b35e..abaa50c84c 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.py
@@ -48,9 +48,8 @@ class JobApplicant(Document):
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 9406fc5485..56331ac132 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 817969004f..67600dc20e 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 08861b8bce..631beef435 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 f6165b3a6f..46401a2dd8 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 d56133b566..8b0b98ddc0 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 f91a8fe520..7cca62e0f5 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 fbe56e2b70..1adae0fda3 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 8311fd2f93..73782d6c81 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 2ffec79c69..dca7e4895e 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 @@ import frappe
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 @@ class LeavePolicyAssignment(Document):
@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 ec6592cb72..4363439b7c 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 8dc9402d1e..074d3e4e52 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 cd4519e879..531c98db5f 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 b523f0e01c..919da2db27 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 c04e5853a5..abde0d5a51 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 8c4162d501..141fffc282 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 51137d162c..374c1e8913 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 bb38ab9d6b..f6e5f06d8c 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 19b550feea..02e3e93333 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 19b550feea..02e3e93333 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 01d95a7051..1e2d758179 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 126ed898c9..0a4624c531 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 19b550feea..02e3e93333 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 9512c8fa19..6144d9d39a 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 @@ def get_data(chart_name = None, chart = None, no_cache = None, filters = None, f
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 423807a9e2..84e0f03bae 100644
--- a/erpnext/loan_management/doctype/loan/loan.py
+++ b/erpnext/loan_management/doctype/loan/loan.py
@@ -8,7 +8,6 @@ import math
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 @@ def make_loan_write_off(loan, company=None, posting_date=None, amount=0, as_dict
@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 0374eda499..c8a9e64f5e 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 d2eb53b10b..24d8d68de0 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 import _
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 @@ def create_pledge(loan_application, loan=None):
#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 01ef9f9d78..e8e2a2a0de 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 42f9a2cc1d..5922e4f902 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 @@ class LoanRepayment(AccountsController):
# 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 8d5c525ac3..964a1ae93a 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 daa9958808..2a9ceed2d8 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 8fce09ce0a..bff9d5cf62 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 @@ import frappe
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 @@ class LoanSecurityUnpledge(Document):
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 @@ def get_pledged_security_qty(loan):
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 19026da2f6..245e102120 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 4195960890..932087cb5a 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 fa9d18b6fa..1f5d8438ff 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 8ebca39061..512b47f799 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 @@ def get_data(filters):
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 e3d9995290..7dbb966233 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 @@ def get_data(filters):
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 @@ def get_company_wise_loan_security_details(filters, loan_security_details):
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 2556f2f163..c6745c877c 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 9b8f6bff09..0699f74aad 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 f9c3b06217..0e3955f5a7 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 @@ import frappe
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 @@ def get_new_bom_unit_cost(bom):
@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 f8f6af34ef..acaa895c1a 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 076f6663be..4fbcf4954e 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 a63ed999e4..7cec7f515a 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -20,7 +20,6 @@ from frappe.utils import (
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 @@ def get_items_for_material_requests(doc, warehouses=None, get_parent_warehouse_d
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 @@ def get_items_for_material_requests(doc, warehouses=None, get_parent_warehouse_d
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 ef009765f9..e13f042e43 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 4bd4192de5..d051e38a34 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 91279d8e61..37dd11aab4 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 c779fbf9c3..bc481ca192 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 19b550feea..02e3e93333 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 d21357a7f4..54bc94b755 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 @@ def capture_razorpay_donations(*args, **kwargs):
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 1d43ba23dc..492ad62171 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 80bb9e3250..0e31e3ceb8 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 b3593d55f0..beb38e2110 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -6,7 +6,6 @@ import json
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 @@ def process_request_data(data):
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 19b550feea..02e3e93333 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 19b550feea..02e3e93333 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 1f82894092..3dfb381f65 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 00d0dd75e4..a2deab6225 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 152c5b3ec4..525d1ff204 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 374df2a4dc..3f3d42400a 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 f111ac7b9d..471f53704d 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 dcb4a57ba2..6530b815cc 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 784b0eeafa..08006ad01b 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 e52d12429b..fdf30469bf 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 8629798ba8..f5658c5b93 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 820199569a..6dcbf99e16 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 1699572551..064b72195f 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 039238f9e1..573021270d 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 b45065cb0d..e7b412cc5f 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 a4cba0cfcc..034418c137 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 5c54925858..f0803cb5c7 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 a7e662c78c..5974e27059 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 00678c781e..43c8504294 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 d897941eab..a1f159483b 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 fc3dbfbab9..80e5ef7f37 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 7866cfab4f..cad9c6cd78 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 85292e8d13..8fa876dd74 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 fb08be8628..4b55aa06bb 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 49dbc8a6dc..95fb55d9b4 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 fd7e684c61..3f87550224 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 a77dee9369..ee083ca4b8 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 a3ece7fc76..b1098abb57 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 262ca2d61f..ec75d454aa 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 5ff9e4ab6f..99c3b0b7c4 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 f23018d0b4..a44daaa197 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 cb38beb51c..bb7ef87747 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 8e2aa47785..d387577310 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 854f522347..81e547b16a 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 4cb2dccbb2..aff8e1556b 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 c7937e532b..ef58499f0f 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 09bb02f959..4e807b4f13 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 7a041919a1..beec63af4b 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 8ad8ff8c2b..ac082b1ae2 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 2da1ecbda2..0d4f3d2ce1 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 385bc209fa..dd9c1d2887 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 1de25bb739..19958eef14 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 41264819ef..f860cb4693 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 df9bbea344..dc9e884918 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 77b63487ca..6316bb3da9 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 fbaf6f83a7..b0ddf001a6 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 e0ed9d8c14..aec9cb8b26 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 0f5e07b5e5..efcc7cf0f7 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 7a1da52128..d157aad8f2 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 df0269d3a8..55717ccab2 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 c0b262395d..b3ee340464 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 677a564af0..905aebee15 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 json
import frappe
from frappe.model.naming import make_autoname
-from six import iteritems
def execute():
@@ -84,7 +83,7 @@ def execute():
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 @@ def get_item_tax_template(item_tax_templates, item_tax_map, item_code, parenttyp
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 c89e4bb9ea..9b083cafb3 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 0f4a366c65..12768a6f95 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 c2c834bf98..e33a1d010d 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 55bf6f223f..96ae9798c6 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 b4f8a0631a..8f29fc888e 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 fe580ce023..d1e0e4550e 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 b70bb18b60..de641c65a1 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 47d4eb599b..50d9fee099 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 @@ def execute():
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 14956a23b4..bd2f7e2dec 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 05b86f3204..a15166ed5f 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 adfc5e9679..91e77e4e0d 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 83db7961d9..d41134d4db 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 57206ced3e..8c136e6663 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 d79628f2a9..154d7ba176 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 1a677f9167..5b5f623b48 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 7683031e27..37d850fab4 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 032c2bb953..e4418b0103 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 48febc5aa4..ef4204fc9c 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 ace3aceebb..132fd900bd 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 20dce94f2f..8b15370b09 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 4e24a638f9..f553ee9d85 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 18787848df..df7875079b 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 a737cb2dfa..abd4f6fb18 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 53e8321667..e5f24d4b88 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 e0382d818e..ea3e002e5d 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 86105a469d..53c0ba525b 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 3184d1195f..a09ac190e2 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 8d9f5cc89b..0208ca914e 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 3bf2762456..71abe2e98e 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 396d3343ba..7fbaffb23c 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 c739a7a93f..24141b7862 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 a95f822d28..ee23747cc0 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 9664247ab4..23cad31f59 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 7ef154e606..bc64c63772 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 ce352a008b..fba9e2c443 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 aea498d8d3..611ba7e324 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 cb3df3c5dd..76f8b27499 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 d43e793b9a..98ce12bc20 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 9faf298c26..a7bdf93332 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 @@ def execute():
'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 ad79c811c0..1c65998009 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 3d999bf324..7c10a313a5 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 e977804322..3bd717d77b 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 ecd03441e0..265e2a9b0c 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 f49b1e4bd8..7d757b7a0f 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 b955686a17..f82a0d56e0 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 3b751415ee..87b3389448 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 a838ce07b9..6a3785d837 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 27a9d3ff08..e44f32157d 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 76aaaea279..e1eb1b9bc2 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 36bedf4f9b..dc3f8aadc1 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 10ecd09306..55fd465b20 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 bcd80d4c5c..e226f1dd56 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 b0bb1c86ee..b67c74de1d 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 @@ def execute():
'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 cc38a0c9a1..a5e3391d53 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 8ef2a94b1c..13071478c8 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 e7ef5ff0b4..c46187ca11 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 98097d0050..ff9e6a48e8 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 b5d58dc2eb..808c833f6f 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 6276bd6640..aeadba186d 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 15e15d1362..e7c67fbe11 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 138fed68f4..a33b28de40 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 eaa67732af..8a3332fa6b 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 7a5b6d0f6d..05af09e49d 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py
@@ -21,7 +21,6 @@ from frappe.utils import (
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 @@ class SalarySlip(TransactionBase):
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 27eb5ed8b1..014d0bab12 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 19b550feea..02e3e93333 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 7a17d1422d..b478489920 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 d0a5819fd3..974b51ef0a 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 df274ed9a9..a7d1835848 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 65cd8d4b55..a03a57dd80 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 40d04e13eb..f7470f8972 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 d9a341d4df..15fe797e23 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 0d97ddf85a..e2ba7c2c26 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 2854ea31fe..dd4f8ea786 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 @@ class EmployeeHoursReport:
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 @@ class EmployeeHoursReport:
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 9959382205..b500bc8ab7 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 31fd361fce..2cf9d38bd0 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 67cad05a48..99249edff1 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 9ad3d470d4..780db40158 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 8445408e64..d48cd67c38 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 @@ import frappe
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 @@ class GSTR3BReport(Document):
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 @@ class GSTR3BReport(Document):
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 be3d7a3e54..8f2dc2dec3 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 d46abe9187..2d1e02eadb 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 @@ def get_datev_csv(data, filters, csv_class):
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 2dc762f0eb..c703575d7d 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 @@ state_numbers = {
"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 61a0e97fe3..c95a0b3cc6 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 e7539f516e..9efad6d05f 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 @@ import frappe
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 @@ def get_place_of_supply(party_details, doctype):
@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 @@ def get_regional_round_off_accounts(company, account_list):
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 4932f660ca..eb20f65afb 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 8d1558be22..c82557b9de 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 @@ import frappe
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 @@ def get_invoice_summary(items, taxes):
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 889732229e..beac7ed65c 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 json
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 @@ def download_datev_csv(filters):
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 7ca0b1b50f..14d5495eed 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 933c522de2..27cfaf7614 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -8,7 +8,6 @@ from datetime import date
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 @@ class Gstr1Report(object):
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 @@ class Gstr1Report(object):
+ "
" + "
".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 @@ def get_b2b_json(res, gstin):
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_b2cs_json(data, gstin):
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 @@ def get_cdnr_reg_json(res, gstin):
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_reg_json(res, gstin):
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 17d611738d..e03ad374ae 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 @@ import frappe
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 @@ def get_merged_data(columns, data):
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 62d694ba7b..41336873ac 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 aedebdfc6a..1d3770aefc 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 891e75e003..f350ec4ec2 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 @@ def update_itemised_tax_data(doc):
# 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 c91ef56142..bfdd052753 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 faf8a4403c..58394d0acb 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 83af81654c..7d6b74d066 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -17,7 +17,6 @@ test_ignore = ["Price List"]
test_dependencies = ['Payment Term', 'Payment Terms Template']
test_records = frappe.get_test_records('Customer')
-from six import iteritems
class TestCustomer(unittest.TestCase):
@@ -90,7 +89,7 @@ class TestCustomer(unittest.TestCase):
details = get_party_details("_Test Customer")
- for key, value in iteritems(to_check):
+ for key, value in to_check.items():
val = details.get(key)
if not val and not isinstance(val, list):
val = None
diff --git a/erpnext/selling/doctype/product_bundle/test_product_bundle.py b/erpnext/selling/doctype/product_bundle/test_product_bundle.py
index b966c62f66..c1e2fdee8b 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 46de292cc4..0a1aad7bb6 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 1ab8aa4f3a..8cb0f29e9b 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.desk.notifications import clear_doctype_notifications
from frappe.model.mapper import get_mapped_doc
from frappe.model.utils import get_fetch_values
from frappe.utils import add_days, cint, cstr, flt, get_link_to_form, getdate, nowdate, strip_html
-from six import string_types
from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
unlink_inter_company_doc,
@@ -790,7 +789,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
"""Creates Purchase Order for each Supplier. Returns a list of doc objects."""
if not selected_items: return
- if isinstance(selected_items, string_types):
+ if isinstance(selected_items, str):
selected_items = json.loads(selected_items)
def set_missing_values(source, target):
@@ -891,7 +890,7 @@ def make_purchase_order_for_default_supplier(source_name, selected_items=None, t
def make_purchase_order(source_name, selected_items=None, target_doc=None):
if not selected_items: return
- if isinstance(selected_items, string_types):
+ if isinstance(selected_items, str):
selected_items = json.loads(selected_items)
items_to_map = [item.get('item_code') for item in selected_items if item.get('item_code') and item.get('item_code')]
@@ -1045,7 +1044,7 @@ def make_raw_material_request(items, company, sales_order, project=None):
if not frappe.has_permission("Sales Order", "write"):
frappe.throw(_("Not permitted"), frappe.PermissionError)
- if isinstance(items, string_types):
+ if isinstance(items, str):
items = frappe._dict(json.loads(items))
for item in items.get('items'):
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index abf507a9e5..1e616b87b2 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 319e78f488..915f8dc3cf 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 @@ def get_party_addresses_and_contact(party_type, party, party_group):
party_details = get_party_details(party_type, party_list, "Address", party_details)
party_details = get_party_details(party_type, party_list, "Contact", party_details)
- for party, details in iteritems(party_details):
+ for party, details in party_details.items():
addresses = details.get("address", [])
contacts = details.get("contact", [])
if not any([addresses, contacts]):
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py
index a380f842eb..83588c3456 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 @@ class Analytics(object):
self.data = []
self.get_periodic_data()
- for entity, period_data in iteritems(self.entity_periodic_data):
+ for entity, period_data in self.entity_periodic_data.items():
row = {
"entity": entity,
"entity_name": self.entity_names.get(entity) if hasattr(self, 'entity_names') else None
diff --git a/erpnext/setup/default_energy_point_rules.py b/erpnext/setup/default_energy_point_rules.py
index cfff75e525..1ce06b8c2f 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 338fb43f24..a1f48df672 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 b63c05dbd1..7cb0b1254f 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 0fbadd98cd..fbd2d94117 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 d0a5dd99df..e946406e63 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 8e6421eba8..658f286f7c 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 import _, throw
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 @@ class TermsandConditions(Document):
@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 67d1143871..86c9b3f178 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -8,7 +8,6 @@ from frappe.custom.doctype.custom_field.custom_field import create_custom_field
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 @@ def add_non_standard_user_types():
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 @@ def create_user_type(user_type, data):
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 e3b33df237..6cb15b2a46 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 542dfc76dc..ecd8b00199 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 afab7e712b..f1ec50afce 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 d1933d2396..dd1b40108c 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 c0ccf54d5f..4fd64312f5 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 a92abf1113..8ae70d2a90 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 9fd1f0e8ce..e8b2804b7d 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 9a83372f3e..57d78a21e1 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 e8b0bea468..c0666cffc7 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 3ce2d87f71..fdefd24878 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -9,7 +9,6 @@ from frappe.model.naming import make_autoname, revert_series_if_last
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 @@ def _make_naming_series_key(prefix):
: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 afa0fca99a..725365b2fc 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 61d8de4a06..ca61a36928 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 b0f1bbc2d5..e16f5bbfeb 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 a9ee4b0742..d717c50919 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -11,7 +11,6 @@ import frappe
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 update_status(name, status):
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 9133859b24..c1ce0a93e2 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 b7987543f2..5484a117dd 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 import _
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 @@ def get_available_item_locations_for_serialized_item(item_code, from_warehouses,
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 d19bedeeaf..ec3047e98f 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 954e47d3be..762f45f75f 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 import _, throw
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 @@ class PurchaseReceipt(BuyingController):
# 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 18da88c375..bdc5435988 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 a4883523fa..102730b055 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 unittest
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 @@ class TestPurchaseReceipt(ERPNextTestCase):
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 25330b7183..523ba120de 100644
--- a/erpnext/stock/doctype/putaway_rule/putaway_rule.py
+++ b/erpnext/stock/doctype/putaway_rule/putaway_rule.py
@@ -10,7 +10,6 @@ import frappe
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 @@ def apply_putaway_rule(doctype, items, company, sync=None, purpose=None):
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 8f41c9da54..d9d1957c0b 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -8,8 +8,6 @@ import frappe
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 @@ def auto_fetch_serial_number(qty, item_code, warehouse, posting_date=None, batch
@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 882b8dfae0..fa2436bd27 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -9,7 +9,6 @@ import frappe
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
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 @@ class StockEntry(StockController):
@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 @@ def get_expired_batch_items():
@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 5832fe49b2..17266ad059 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 @@ def make_stock_entry(**args):
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 d5d40c116e..067946785a 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 unittest
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 @@ from erpnext.stock.stock_ledger import get_previous_sle
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 9f0af49594..93bca7a694 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 6de04c41a5..438d3ebc4d 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -8,7 +8,6 @@ import frappe
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 @@ def get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=Tru
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 @@ def get_item_details(args, doc=None, for_validate=False, overwrite_warehouse=Tru
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 set_valuation_rate(out, args):
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 @@ def process_args(args):
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 @@ def get_gross_profit(out):
@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 @@ def update_party_blanket_order(args, out):
@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 960396d534..a22b224867 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 @@ def execute(filters=None):
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 cf27326559..a381820ca2 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 get_data(filters):
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 5f03c7cbe0..d452ffd913 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 copy
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 @@ def get_incorrect_serial_nos(serial_nos_data):
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 7cce4a7d22..28e6cb2d27 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 @@ def get_data(report_filters):
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 3c4dbce73a..d9adceddf1 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 @@ def execute(filters=None):
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 1209be21ed..0ebe4f903f 100644
--- a/erpnext/stock/report/stock_ageing/stock_ageing.py
+++ b/erpnext/stock/report/stock_ageing/stock_ageing.py
@@ -7,7 +7,6 @@ from operator import itemgetter
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 @@ def execute(filters=None):
_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 963c4489e4..c0b89fdd09 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -7,7 +7,6 @@ from operator import itemgetter
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 @@ def filter_items_with_no_transactions(iwb_map, float_precision):
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 @@ def get_item_details(items, sle, filters):
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 11559aa208..d1748ed24b 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 @@ def execute(filters=None):
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 @@ def get_suppliers_details(filters):
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 b43921f859..d3af5f61e3 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 @@ def execute(filters=None):
# 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 f694da03ea..9c4c676192 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -8,7 +8,6 @@ import frappe
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 @@ def repost_future_sle(args=None, voucher_type=None, voucher_no=None, allow_negat
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 @@ class update_entries_after(object):
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 @@ class update_entries_after(object):
# 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 @@ class update_entries_after(object):
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 @@ class update_entries_after(object):
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 @@ class update_entries_after(object):
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 5aafecf018..8031c58b81 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -7,7 +7,6 @@ import json
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 update_bin(args, allow_negative_stock=False, via_landed_cost_voucher=False):
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 b9a7c1e8ce..ac23ede49e 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 e2de992e19..7ab358a9ad 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 543a34cb30..056f2e0b41 100644
--- a/erpnext/support/report/issue_analytics/issue_analytics.py
+++ b/erpnext/support/report/issue_analytics/issue_analytics.py
@@ -7,7 +7,6 @@ import json
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 @@ class IssueAnalytics(object):
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 b27dc46ad2..ba4dc54887 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 b5d52278b8..39a5c407cd 100644
--- a/erpnext/support/report/issue_summary/issue_summary.py
+++ b/erpnext/support/report/issue_summary/issue_summary.py
@@ -7,7 +7,6 @@ import json
import frappe
from frappe import _, scrub
from frappe.utils import flt
-from six import iteritems
def execute(filters=None):
@@ -141,7 +140,7 @@ class IssueSummary(object):
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 e3a7e5f54b..6b2098f4a8 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 @@ def get_data(filters):
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 19b550feea..02e3e93333 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 d36ee6e23b..22c62ceecc 100644
--- a/erpnext/templates/includes/salary_slip_log.html
+++ b/erpnext/templates/includes/salary_slip_log.html
@@ -10,7 +10,7 @@