diff --git a/frappe/desk/doctype/number_card/number_card.js b/frappe/desk/doctype/number_card/number_card.js index 9bc071b723..5ad5d76ac8 100644 --- a/frappe/desk/doctype/number_card/number_card.js +++ b/frappe/desk/doctype/number_card/number_card.js @@ -24,6 +24,7 @@ frappe.ui.form.on('Number Card', { } frm.filters = eval(frm.doc.filters_config); frm.trigger('set_filters_description'); + frm.trigger('set_method_description'); frm.trigger('render_filters_table'); } frm.trigger('create_add_to_dashboard_button'); @@ -110,6 +111,21 @@ frappe.ui.form.on('Number Card', { } }, + set_method_description: function(frm) { + console.log('called'); + if (frm.doc.type == 'Custom') { + frm.fields_dict.method.set_description(` + Set the path to a whitelisted function that will return the number on the card in the format: +
+
+{
+ "value": value,
+ "fieldtype": "Currency"
+}
+`)
+ }
+ },
+
type: function(frm) {
frm.trigger('set_filters_description');
if (frm.doc.type == 'Report') {
diff --git a/frappe/desk/doctype/number_card/number_card.json b/frappe/desk/doctype/number_card/number_card.json
index 1d0528b298..e94a06dab8 100644
--- a/frappe/desk/doctype/number_card/number_card.json
+++ b/frappe/desk/doctype/number_card/number_card.json
@@ -164,7 +164,6 @@
},
{
"depends_on": "eval: doc.type == 'Custom'",
- "description": "This should contain the path to a whitelisted function that will return the number on the card",
"fieldname": "method",
"fieldtype": "Data",
"label": "Method",
@@ -192,7 +191,7 @@
}
],
"links": [],
- "modified": "2020-07-16 13:04:03.470001",
+ "modified": "2020-07-17 18:04:00.814756",
"modified_by": "Administrator",
"module": "Desk",
"name": "Number Card",