frappe.ui.form.on('Item Group', {
    refresh: function(frm) {
        if (frm.doc.is_standard) {
            frm.set_intro(__("This is a root item group and cannot be edited."), true);
            frm.disable_form();
        }
    },
    
    onload: function(frm) {
        if (frm.doc.is_standard) {
            frm.set_intro(__("This is a root item group and cannot be edited."), true);
            frm.disable_form();
        }
    },
    
    is_standard: function(frm) {
        if (frm.doc.is_standard) {
            frm.set_intro(__("This is a root item group and cannot be edited."), true);
            frm.disable_form();
        } else {
            frm.set_intro('');
            frm.enable_form();
        }
    }
});