fix: travis failing (#19568)

This commit is contained in:
rohitwaghchaure 2019-11-13 18:58:22 +05:30 committed by Nabin Hait
parent 732d6afad5
commit 94565d69d1
2 changed files with 7 additions and 1 deletions

View File

@ -14,10 +14,14 @@ class CurrencyExchange(Document):
purpose = ""
if not self.date:
self.date = nowdate()
# If both selling and buying enabled
purpose = "Selling-Buying"
if cint(self.for_buying)==0 and cint(self.for_selling)==1:
purpose = "Selling"
if cint(self.for_buying)==1 and cint(self.for_selling)==0:
purpose = "Buying"
self.name = '{0}-{1}-{2}{3}'.format(formatdate(get_datetime_str(self.date), "yyyy-MM-dd"),
self.from_currency, self.to_currency, ("-" + purpose) if purpose else "")

View File

@ -11,7 +11,9 @@ test_records = frappe.get_test_records('Currency Exchange')
def save_new_records(test_records):
for record in test_records:
purpose = str("")
# If both selling and buying enabled
purpose = "Selling-Buying"
if cint(record.get("for_buying"))==0 and cint(record.get("for_selling"))==1:
purpose = "Selling"
if cint(record.get("for_buying"))==1 and cint(record.get("for_selling"))==0: