fix: travis failing (#19568)
diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py
index 60d367a..6480f60 100644
--- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py
+++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py
@@ -14,10 +14,14 @@
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 "")
diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py
index 857f666..c5c01c5 100644
--- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py
+++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py
@@ -11,7 +11,9 @@
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: