Merge pull request #12614 from rohitwaghchaure/removed_set_only_once_for_batch_serialno

Disabled property set only once for has serial no and has batch no field in item doctype
This commit is contained in:
Saurabh 2018-01-23 18:08:56 +05:30 committed by GitHub
commit c8399fd093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -106,6 +106,13 @@ frappe.ui.form.on("Item", {
frappe.set_route("Form", "Item Variant Settings");
}, __("View"));
}
const stock_exists = (frm.doc.__onload
&& frm.doc.__onload.stock_exists) ? 1 : 0;
['has_serial_no', 'has_batch_no'].forEach((fieldname) => {
frm.set_df_property(fieldname, 'read_only', stock_exists);
});
},
validate: function(frm){

View File

@ -1180,7 +1180,7 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
"set_only_once": 0,
"unique": 0
},
{
@ -1370,7 +1370,7 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
"set_only_once": 0,
"unique": 0
},
{
@ -3453,7 +3453,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
"modified": "2017-12-27 15:47:17.039337",
"modified": "2018-01-23 12:21:16.641517",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",