[FIX] use text_type instead of unicode, use cmp from past.builtins

This commit is contained in:
Achilles Rasquinha
2018-03-08 12:55:41 +05:30
parent c3bf1fa009
commit 9050998e06
3 changed files with 4 additions and 2 deletions

View File

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