[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

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

View File

@ -4,7 +4,7 @@
from __future__ import unicode_literals
import re
from past.builtins import cmp
import functools
import frappe

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