Merge branch 'hotfix' into py3-hotfix
This commit is contained in:
@@ -350,7 +350,7 @@ def filter_pricing_rules(args, pricing_rules):
|
|||||||
if len(pricing_rules) > 1:
|
if len(pricing_rules) > 1:
|
||||||
rate_or_discount = list(set([d.rate_or_discount for d in pricing_rules]))
|
rate_or_discount = list(set([d.rate_or_discount for d in pricing_rules]))
|
||||||
if len(rate_or_discount) == 1 and rate_or_discount[0] == "Discount Percentage":
|
if len(rate_or_discount) == 1 and rate_or_discount[0] == "Discount Percentage":
|
||||||
pricing_rules = filter(lambda x: x.for_price_list==args.price_list, pricing_rules) \
|
pricing_rules = list(filter(lambda x: x.for_price_list==args.price_list, pricing_rules)) \
|
||||||
or pricing_rules
|
or pricing_rules
|
||||||
|
|
||||||
if len(pricing_rules) > 1 and not args.for_shopping_cart:
|
if len(pricing_rules) > 1 and not args.for_shopping_cart:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
|
|||||||
invoices = []
|
invoices = []
|
||||||
|
|
||||||
# create invoices for lower than single threshold tax rate
|
# create invoices for lower than single threshold tax rate
|
||||||
for _ in xrange(2):
|
for _ in range(2):
|
||||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier")
|
pi = create_purchase_invoice(supplier = "Test TDS Supplier")
|
||||||
pi.submit()
|
pi.submit()
|
||||||
invoices.append(pi)
|
invoices.append(pi)
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ class AssetValueAdjustment(Document):
|
|||||||
rate_per_day = flt(d.value_after_depreciation) / flt(total_days)
|
rate_per_day = flt(d.value_after_depreciation) / flt(total_days)
|
||||||
from_date = self.date
|
from_date = self.date
|
||||||
else:
|
else:
|
||||||
no_of_depreciations = len([e.name for e in asset.schedules
|
no_of_depreciations = len([s.name for s in asset.schedules
|
||||||
if (cint(s.finance_book_id) == d.idx and not e.journal_entry)])
|
if (cint(s.finance_book_id) == d.idx and not s.journal_entry)])
|
||||||
|
|
||||||
value_after_depreciation = d.value_after_depreciation
|
value_after_depreciation = d.value_after_depreciation
|
||||||
for data in asset.schedules:
|
for data in asset.schedules:
|
||||||
|
|||||||
@@ -25,9 +25,12 @@ class TestLocation(unittest.TestCase):
|
|||||||
temp['features'][0]['properties']['feature_of'] = location
|
temp['features'][0]['properties']['feature_of'] = location
|
||||||
formatted_locations.extend(temp['features'])
|
formatted_locations.extend(temp['features'])
|
||||||
|
|
||||||
formatted_location_string = str(formatted_locations)
|
|
||||||
test_location = frappe.get_doc('Location', 'Test Location Area')
|
test_location = frappe.get_doc('Location', 'Test Location Area')
|
||||||
test_location.save()
|
test_location.save()
|
||||||
|
|
||||||
self.assertEqual(formatted_location_string, str(json.loads(test_location.get('location'))['features']))
|
test_location_features = json.loads(test_location.get('location'))['features']
|
||||||
|
ordered_test_location_features = sorted(test_location_features, key=lambda x: x['properties']['feature_of'])
|
||||||
|
ordered_formatted_locations = sorted(formatted_locations, key=lambda x: x['properties']['feature_of'])
|
||||||
|
|
||||||
|
self.assertEqual(ordered_formatted_locations, ordered_test_location_features)
|
||||||
self.assertEqual(area, test_location.get('area'))
|
self.assertEqual(area, test_location.get('area'))
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ def call_mws_method(mws_method, *args, **kwargs):
|
|||||||
mws_settings = frappe.get_doc("Amazon MWS Settings")
|
mws_settings = frappe.get_doc("Amazon MWS Settings")
|
||||||
max_retries = mws_settings.max_retry_limit
|
max_retries = mws_settings.max_retry_limit
|
||||||
|
|
||||||
for x in xrange(0, max_retries):
|
for x in range(0, max_retries):
|
||||||
try:
|
try:
|
||||||
response = mws_method(*args, **kwargs)
|
response = mws_method(*args, **kwargs)
|
||||||
return response
|
return response
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from erpnext.stock.stock_balance import get_planned_qty, update_bin_qty
|
|||||||
from frappe.utils.csvutils import getlink
|
from frappe.utils.csvutils import getlink
|
||||||
from erpnext.stock.utils import get_bin, validate_warehouse_company, get_latest_stock_qty
|
from erpnext.stock.utils import get_bin, validate_warehouse_company, get_latest_stock_qty
|
||||||
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
from erpnext.utilities.transaction_base import validate_uom_is_integer
|
||||||
|
from six import text_type
|
||||||
|
|
||||||
class OverProductionError(frappe.ValidationError): pass
|
class OverProductionError(frappe.ValidationError): pass
|
||||||
class StockOverProductionError(frappe.ValidationError): pass
|
class StockOverProductionError(frappe.ValidationError): pass
|
||||||
@@ -591,10 +592,10 @@ def make_timesheet(production_order, company):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def add_timesheet_detail(timesheet, args):
|
def add_timesheet_detail(timesheet, args):
|
||||||
if isinstance(timesheet, unicode):
|
if isinstance(timesheet, text_type):
|
||||||
timesheet = frappe.get_doc('Timesheet', timesheet)
|
timesheet = frappe.get_doc('Timesheet', timesheet)
|
||||||
|
|
||||||
if isinstance(args, unicode):
|
if isinstance(args, text_type):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
timesheet.append('time_logs', args)
|
timesheet.append('time_logs', args)
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ class TestTimesheet(unittest.TestCase):
|
|||||||
{
|
{
|
||||||
"billable": 1,
|
"billable": 1,
|
||||||
"activity_type": "_Test Activity Type",
|
"activity_type": "_Test Activity Type",
|
||||||
"from_type": now_datetime(),
|
"from_time": now_datetime(),
|
||||||
"hours": 3,
|
"to_time": now_datetime() + datetime.timedelta(hours=3),
|
||||||
"company": "_Test Company"
|
"company": "_Test Company"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -113,8 +113,8 @@ class TestTimesheet(unittest.TestCase):
|
|||||||
{
|
{
|
||||||
"billable": 1,
|
"billable": 1,
|
||||||
"activity_type": "_Test Activity Type",
|
"activity_type": "_Test Activity Type",
|
||||||
"from_type": now_datetime(),
|
"from_time": now_datetime(),
|
||||||
"hours": 3,
|
"to_time": now_datetime() + datetime.timedelta(hours=3),
|
||||||
"company": "_Test Company"
|
"company": "_Test Company"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ def get_result_as_list(data, filters):
|
|||||||
if account_number[0] is not None:
|
if account_number[0] is not None:
|
||||||
CompteNum = account_number[0]
|
CompteNum = account_number[0]
|
||||||
else:
|
else:
|
||||||
frappe.throw(_("Account number for account {0} is not available.<br> Please setup your Chart of Accounts correctly.").format(account.name))
|
frappe.throw(_("Account number for account {0} is not available.<br> Please setup your Chart of Accounts correctly.").format(d.get("account")))
|
||||||
|
|
||||||
if d.get("party_type") == "Customer":
|
if d.get("party_type") == "Customer":
|
||||||
CompAuxNum = d.get("cusName")
|
CompAuxNum = d.get("cusName")
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from jinja2 import utils
|
|||||||
from html2text import html2text
|
from html2text import html2text
|
||||||
from frappe.utils import sanitize_html
|
from frappe.utils import sanitize_html
|
||||||
from frappe.utils.global_search import search
|
from frappe.utils.global_search import search
|
||||||
|
from six import text_type
|
||||||
|
|
||||||
def get_context(context):
|
def get_context(context):
|
||||||
context.no_cache = 1
|
context.no_cache = 1
|
||||||
@@ -73,7 +74,7 @@ def prepare_api_results(api, topics_data):
|
|||||||
for topic in topics_data:
|
for topic in topics_data:
|
||||||
route = api.base_url + '/' + (api.post_route + '/' if api.post_route else "")
|
route = api.base_url + '/' + (api.post_route + '/' if api.post_route else "")
|
||||||
for key in api.post_route_key_list.split(','):
|
for key in api.post_route_key_list.split(','):
|
||||||
route += unicode(topic[key])
|
route += text_type(topic[key])
|
||||||
|
|
||||||
results.append(frappe._dict({
|
results.append(frappe._dict({
|
||||||
'title': topic[api.post_title_key],
|
'title': topic[api.post_title_key],
|
||||||
|
|||||||
Reference in New Issue
Block a user