Browse Source

App Labels: empty parent label for is group fie;d

version2
venkataakhil 1 year ago
parent
commit
360439782e
  1. 25
      smart_service/masters/doctype/app_labels/app_labels.js

25
smart_service/masters/doctype/app_labels/app_labels.js

@ -3,25 +3,28 @@
frappe.ui.form.on('App Labels', { frappe.ui.form.on('App Labels', {
is_group: function(frm) { is_group: function (frm) {
if (frm.doc.is_group){ if (frm.doc.is_group) {
frm.set_value("language", "en"); frm.set_value("language", "en");
frm.set_df_property('language', 'read_only', 1); frm.set_df_property('language', 'read_only', 1);
frm.set_df_property('label', 'read_only', 1); frm.set_df_property('label', 'read_only', 1);
frm.set_df_property('parent_app_labels', 'hidden', 1); frm.set_df_property('parent_app_labels', 'hidden', 1);
} else { } else {
frm.set_df_property('language', 'read_only', 0); frm.set_df_property('language', 'read_only', 0);
frm.set_df_property('label', 'read_only', 0); frm.set_df_property('label', 'read_only', 0);
frm.set_df_property('parent_app_labels', 'hidden', 0); frm.set_df_property('parent_app_labels', 'hidden', 0);
} }
}, },
english_label: function(frm) { english_label: function (frm) {
if (frm.doc.is_group){ if (frm.doc.is_group) {
frm.set_value("label", frm.doc.english_label); frm.set_value("label", frm.doc.english_label);
} }
}, },
validate: function (frm) { validate: function (frm) {
if (frm.doc.is_group) {
frm.doc.parent_app_labels = null
}
if (frm.doc.english_label) { if (frm.doc.english_label) {
if (frm.doc.english_label.length > 100) { if (frm.doc.english_label.length > 100) {
frappe.msgprint("<b>English Label :</b> Only <b> 50 </b> characters allowed") frappe.msgprint("<b>English Label :</b> Only <b> 50 </b> characters allowed")

Loading…
Cancel
Save