feat: init CES default values

This commit is contained in:
rtdany10
2021-09-03 15:50:05 +05:30
parent e093863c9e
commit d8b8032de1
3 changed files with 14 additions and 7 deletions

View File

@@ -57,7 +57,13 @@ def set_single_defaults():
pass
except frappe.ValidationError:
pass
ces = frappe.get_single('Currency Exchange Settings')
ces.api_endpoint = "https://api.exchangerate.host/convert"
ces.append('result_key', {'key': 'result'})
ces.append('req_params', {'key': 'date', 'value': 'transaction_date'})
ces.append('req_params', {'key': 'from', 'value': 'from_currency'})
ces.append('req_params', {'key': 'to', 'value': 'to_currency'})
ces.save()
frappe.db.set_default("date_format", "dd-mm-yyyy")