From 9050998e06dad9a805c116a88b46aff4abaeec71 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Thu, 8 Mar 2018 12:55:41 +0530 Subject: [PATCH] [FIX] use text_type instead of unicode, use cmp from past.builtins --- erpnext/accounts/doctype/tax_rule/tax_rule.py | 1 + erpnext/accounts/report/financial_statements.py | 2 +- erpnext/controllers/accounts_controller.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py index 028fa723dd..ddef65799b 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py @@ -3,6 +3,7 @@ # For license information, please see license.txt from __future__ import unicode_literals +from past.builtins import cmp import frappe from frappe import _ from frappe.model.document import Document diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index f3e52031ed..ffe860e8ec 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import re - +from past.builtins import cmp import functools import frappe diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 08460a03c7..c6d911a26f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -11,6 +11,7 @@ from erpnext.utilities.transaction_base import TransactionBase from erpnext.controllers.sales_and_purchase_return import validate_return from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled from erpnext.exceptions import InvalidCurrency +from six import text_type force_item_fields = ("item_group", "brand", "stock_uom") @@ -932,7 +933,7 @@ def get_payment_terms(terms_template, posting_date=None, grand_total=None, bill_ @frappe.whitelist() def get_payment_term_details(term, posting_date=None, grand_total=None, bill_date=None): term_details = frappe._dict() - if isinstance(term, unicode): + if isinstance(term, text_type): term = frappe.get_doc("Payment Term", term) else: term_details.payment_term = term.payment_term