Hi guys,
we have a very strange behaviour when running the following custom script (example to demonstrate):
frappe.ui.form.on("Customer", {
refresh: function(frm) {
var sinv = frappe.get_doc("Sales Invoice", 'SINV-00001');
if (sinv != null) {
frappe.msgprint("Customer: " + sinv.customer);
}
else {
frappe.msgprint("SINV not found");
}
}
});
Expected behaviour: Message displayed with “Customer: (customer name)” whenever a customer record is refreshed.
Actual behaviour: first time a customer record is opened, it correctly displays the message. If you click F5 (refresh), the not found message appears.
Any ideas why? Version is ERPNext: v9.1.5 (master), Frappe Framework: v9.1.7 (master), it reproduces over different installations…