fix: Insert Supplier Group via List View (#22403)
This commit is contained in:
parent
9c25101d9b
commit
7af7bb8311
@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
// read-only for root customer group
|
||||
if(!doc.parent_customer_group) {
|
||||
if(!doc.parent_customer_group && !doc.__islocal) {
|
||||
cur_frm.set_read_only();
|
||||
cur_frm.set_intro(__("This is a root customer group and cannot be edited."));
|
||||
} else {
|
||||
@ -20,7 +20,8 @@ cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
cur_frm.fields_dict['parent_customer_group'].get_query = function(doc,cdt,cdn) {
|
||||
return {
|
||||
filters: {
|
||||
'is_group': 1
|
||||
'is_group': 1,
|
||||
'name': ['!=', cur_frm.doc.customer_group_name]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ frappe.ui.form.on("Item Group", {
|
||||
set_root_readonly: function(frm) {
|
||||
// read-only for root item group
|
||||
frm.set_intro("");
|
||||
if(!frm.doc.parent_item_group) {
|
||||
if(!frm.doc.parent_item_group && !frm.doc.__islocal) {
|
||||
frm.set_read_only();
|
||||
frm.set_intro(__("This is a root item group and cannot be edited."), true);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ frappe.ui.form.on('Sales Person', {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
frm.make_methods = {
|
||||
'Sales Order': () => frappe.new_doc("Sales Order")
|
||||
.then(() => frm.add_child("sales_team", {"sales_person": frm.doc.name}))
|
||||
@ -33,7 +33,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
// read-only for root
|
||||
if(!doc.parent_sales_person) {
|
||||
if(!doc.parent_sales_person && !doc.__islocal) {
|
||||
cur_frm.set_read_only();
|
||||
cur_frm.set_intro(__("This is a root sales person and cannot be edited."));
|
||||
} else {
|
||||
|
@ -8,7 +8,7 @@ cur_frm.cscript.refresh = function(doc) {
|
||||
|
||||
cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
// read-only for root customer group
|
||||
if(!doc.parent_supplier_group) {
|
||||
if(!doc.parent_supplier_group && !doc.__islocal) {
|
||||
cur_frm.set_read_only();
|
||||
cur_frm.set_intro(__("This is a root supplier group and cannot be edited."));
|
||||
} else {
|
||||
@ -20,7 +20,8 @@ cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
cur_frm.fields_dict['parent_supplier_group'].get_query = function() {
|
||||
return {
|
||||
filters: {
|
||||
'is_group': 1
|
||||
'is_group': 1,
|
||||
'name': ['!=', cur_frm.doc.supplier_group_name]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.set_root_readonly = function(doc) {
|
||||
// read-only for root territory
|
||||
if(!doc.parent_territory) {
|
||||
if(!doc.parent_territory && !doc.__islocal) {
|
||||
cur_frm.set_read_only();
|
||||
cur_frm.set_intro(__("This is a root territory and cannot be edited."));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user