mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
fix: travis failing (#19568)
This commit is contained in:
committed by
Nabin Hait
parent
732d6afad5
commit
94565d69d1
@@ -14,10 +14,14 @@ class CurrencyExchange(Document):
|
|||||||
purpose = ""
|
purpose = ""
|
||||||
if not self.date:
|
if not self.date:
|
||||||
self.date = nowdate()
|
self.date = nowdate()
|
||||||
|
|
||||||
|
# If both selling and buying enabled
|
||||||
|
purpose = "Selling-Buying"
|
||||||
if cint(self.for_buying)==0 and cint(self.for_selling)==1:
|
if cint(self.for_buying)==0 and cint(self.for_selling)==1:
|
||||||
purpose = "Selling"
|
purpose = "Selling"
|
||||||
if cint(self.for_buying)==1 and cint(self.for_selling)==0:
|
if cint(self.for_buying)==1 and cint(self.for_selling)==0:
|
||||||
purpose = "Buying"
|
purpose = "Buying"
|
||||||
|
|
||||||
self.name = '{0}-{1}-{2}{3}'.format(formatdate(get_datetime_str(self.date), "yyyy-MM-dd"),
|
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 "")
|
self.from_currency, self.to_currency, ("-" + purpose) if purpose else "")
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ test_records = frappe.get_test_records('Currency Exchange')
|
|||||||
|
|
||||||
def save_new_records(test_records):
|
def save_new_records(test_records):
|
||||||
for record in 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:
|
if cint(record.get("for_buying"))==0 and cint(record.get("for_selling"))==1:
|
||||||
purpose = "Selling"
|
purpose = "Selling"
|
||||||
if cint(record.get("for_buying"))==1 and cint(record.get("for_selling"))==0:
|
if cint(record.get("for_buying"))==1 and cint(record.get("for_selling"))==0:
|
||||||
|
|||||||
Reference in New Issue
Block a user