fix: added date field in currency exchange doctype
This commit is contained in:
parent
0be737914a
commit
f4b81b3761
@ -7,10 +7,10 @@
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"from_currency",
|
||||
"exchange_rate",
|
||||
"column_break_knzx",
|
||||
"to_currency",
|
||||
"section_break_nsen",
|
||||
"exchange_rate"
|
||||
"date"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
@ -39,14 +39,16 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_nsen",
|
||||
"fieldtype": "Section Break"
|
||||
"description": "Date at which exchange rate was fetched",
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date"
|
||||
}
|
||||
],
|
||||
"grid_page_length": 50,
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2025-07-09 14:36:54.390864",
|
||||
"modified": "2025-07-09 14:48:14.486500",
|
||||
"modified_by": "Administrator",
|
||||
"module": "FCRM",
|
||||
"name": "CRM Currency Exchange",
|
||||
|
||||
@ -24,7 +24,7 @@ class CRMCurrencyExchange(Document):
|
||||
@frappe.whitelist()
|
||||
def update_exchange_rate(self):
|
||||
exchange_rate = get_exchange_rate(self.from_currency, self.to_currency)
|
||||
self.db_set("exchange_rate", exchange_rate)
|
||||
self.db_set({"exchange_rate": exchange_rate, "date": frappe.utils.now()})
|
||||
return exchange_rate
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user