fix: update description of method field

This commit is contained in:
prssanna 2020-07-17 18:13:18 +05:30
parent c4a8852a68
commit 3551fecd74
2 changed files with 17 additions and 2 deletions

View file

@ -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:
<pre class="small text-muted">
<code>
{
"value": value,
"fieldtype": "Currency"
}
</code></pre>`)
}
},
type: function(frm) {
frm.trigger('set_filters_description');
if (frm.doc.type == 'Report') {

View file

@ -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",