Hi! I have a Doctype call “Viaticos” with a child table call “Itinerario”. I have a field in the child table “fecha” where I want to choose the date and get the exchange rate. I have this script, it works, but I have to touch the link field cambio = Currency Exchange, because it does not refresh automatically. How can I do that?
frappe.ui.form.on("Itinerario", "fecha", function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
frappe.model.set_value(child.doctype, child.name, "cambio", child.fecha + "-USD-ARS");
cur_frm.add_fetch("cambio", "exchange_rate", "cotizacion");
cur_frm.refresh_field("cambio");
});