Item Group delete permission, Serial No status and item code should be non-editable. Fixes #1564
This commit is contained in:
parent
24a3ec57e3
commit
4ab5382d3f
@ -3,7 +3,7 @@
|
|||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:item_group_name",
|
"autoname": "field:item_group_name",
|
||||||
"creation": "2013-03-28 10:35:29.000000",
|
"creation": "2013-03-28 10:35:29",
|
||||||
"description": "Item Classification",
|
"description": "Item Classification",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@ -12,6 +12,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "item_group_name",
|
"fieldname": "item_group_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
"label": "Item Group Name",
|
"label": "Item Group Name",
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"oldfieldname": "item_group_name",
|
"oldfieldname": "item_group_name",
|
||||||
@ -23,6 +24,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "page_name",
|
"fieldname": "page_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
"label": "Page Name",
|
"label": "Page Name",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
@ -30,6 +32,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "cb0",
|
"fieldname": "cb0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
|
"in_list_view": 1,
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -37,6 +40,7 @@
|
|||||||
"fieldname": "parent_item_group",
|
"fieldname": "parent_item_group",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"ignore_restrictions": 1,
|
"ignore_restrictions": 1,
|
||||||
|
"in_list_view": 1,
|
||||||
"label": "Parent Item Group",
|
"label": "Parent Item Group",
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"oldfieldname": "parent_item_group",
|
"oldfieldname": "parent_item_group",
|
||||||
@ -50,6 +54,7 @@
|
|||||||
"description": "Only leaf nodes are allowed in transaction",
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
"fieldname": "is_group",
|
"fieldname": "is_group",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
|
"in_list_view": 1,
|
||||||
"label": "Has Child Node",
|
"label": "Has Child Node",
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"oldfieldname": "is_group",
|
"oldfieldname": "is_group",
|
||||||
@ -157,7 +162,7 @@
|
|||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2014-02-20 18:29:57.000000",
|
"modified": "2014-05-04 00:06:26.075492",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Item Group",
|
"name": "Item Group",
|
||||||
@ -194,7 +199,7 @@
|
|||||||
{
|
{
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print": 1,
|
"print": 1,
|
||||||
|
@ -184,6 +184,8 @@ cur_frm.cscript.copy_from_item_group = function(doc) {
|
|||||||
cur_frm.cscript.image = function() {
|
cur_frm.cscript.image = function() {
|
||||||
refresh_field("image_view");
|
refresh_field("image_view");
|
||||||
|
|
||||||
|
if(!cur_frm.doc.image) return;
|
||||||
|
|
||||||
if(!cur_frm.doc.description_html)
|
if(!cur_frm.doc.description_html)
|
||||||
cur_frm.cscript.add_image(cur_frm.doc);
|
cur_frm.cscript.add_image(cur_frm.doc);
|
||||||
else {
|
else {
|
||||||
|
@ -13,4 +13,8 @@ cur_frm.cscript.onload = function() {
|
|||||||
cur_frm.set_query("item_code", function() {
|
cur_frm.set_query("item_code", function() {
|
||||||
return erpnext.queries.item({"is_stock_item": "Yes", "has_serial_no": "Yes"})
|
return erpnext.queries.item({"is_stock_item": "Yes", "has_serial_no": "Yes"})
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
frappe.ui.form.on("Serial No", "refresh", function(frm) {
|
||||||
|
frm.toggle_enable("item_code", frm.doc.__islocal);
|
||||||
|
});
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:serial_no",
|
"autoname": "field:serial_no",
|
||||||
"creation": "2013-05-16 10:59:15.000000",
|
"creation": "2013-05-16 10:59:15",
|
||||||
"description": "Distinct unit of an Item",
|
"description": "Distinct unit of an Item",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "In Store",
|
"default": "Not Available",
|
||||||
"description": "Only Serial Nos with status \"Available\" can be delivered.",
|
"description": "Only Serial Nos with status \"Available\" can be delivered.",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
@ -34,9 +34,9 @@
|
|||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "status",
|
"oldfieldname": "status",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "\nAvailable\nNot Available\nDelivered\nPurchase Returned\nSales Returned",
|
"options": "Not Available\nAvailable\nDelivered\nPurchase Returned\nSales Returned",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0,
|
"read_only": 1,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
@ -418,7 +418,7 @@
|
|||||||
"icon": "icon-barcode",
|
"icon": "icon-barcode",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"modified": "2014-01-20 17:49:26.000000",
|
"modified": "2014-05-04 00:47:20.443476",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Serial No",
|
"name": "Serial No",
|
||||||
|
@ -262,7 +262,7 @@ def update_serial_nos(sle, item_det):
|
|||||||
sr = frappe.get_doc("Serial No", serial_no)
|
sr = frappe.get_doc("Serial No", serial_no)
|
||||||
sr.via_stock_ledger = True
|
sr.via_stock_ledger = True
|
||||||
sr.warehouse = sle.warehouse if sle.actual_qty > 0 else None
|
sr.warehouse = sle.warehouse if sle.actual_qty > 0 else None
|
||||||
sr.save()
|
sr.save(ignore_permissions=True)
|
||||||
elif sle.actual_qty > 0:
|
elif sle.actual_qty > 0:
|
||||||
make_serial_no(serial_no, sle)
|
make_serial_no(serial_no, sle)
|
||||||
|
|
||||||
@ -277,6 +277,7 @@ def get_serial_nos(serial_no):
|
|||||||
|
|
||||||
def make_serial_no(serial_no, sle):
|
def make_serial_no(serial_no, sle):
|
||||||
sr = frappe.new_doc("Serial No")
|
sr = frappe.new_doc("Serial No")
|
||||||
|
sr.ignore_permissions = True
|
||||||
sr.serial_no = serial_no
|
sr.serial_no = serial_no
|
||||||
sr.item_code = sle.item_code
|
sr.item_code = sle.item_code
|
||||||
sr.warehouse = None
|
sr.warehouse = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user