fix: minor changes

Clear headline to avoid duplicate headlines.
Dont show headline for new forms
This commit is contained in:
Faris Ansari 2020-10-20 15:07:10 +05:30
parent f7e45d1acd
commit 7d57d8030b

View file

@ -8,14 +8,14 @@ frappe.ui.form.on('Web Template', {
}
frm.toggle_display('standard', frappe.boot.developer_mode);
frm.toggle_display('template', !frm.doc.standard);
},
standard: function(frm) {
if (!frm.doc.standard) {
if (!frm.doc.standard && !frm.is_new()) {
// If standard changes from true to false, hide template until
// the next save. Changes will get overwritten from the backend
// on save and should not be possible in the UI.
frm.toggle_display('template', false);
frm.dashboard.clear_headline();
frm.dashboard.set_headline(__('Please save to edit the template.'));
}
}