feat: Provision to disable serial no and batch selector (#24398)
* feat: feat: Provision to disbale serial no and batch selector * fix: Sider issues * fix: Linting issues
This commit is contained in:
parent
bd9bdc5797
commit
16bcd01f6d
@ -589,11 +589,21 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
|
return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
if (r.message &&
|
if (r.message &&
|
||||||
(r.message.has_batch_no || r.message.has_serial_no)) {
|
(r.message.has_batch_no || r.message.has_serial_no)) {
|
||||||
frappe.flags.hide_serial_batch_dialog = false;
|
frappe.flags.hide_serial_batch_dialog = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
() => {
|
||||||
|
// check if batch serial selector is disabled or not
|
||||||
|
if (show_batch_dialog && !frappe.flags.hide_serial_batch_dialog)
|
||||||
|
return frappe.db.get_single_value('Stock Settings', 'disable_serial_no_and_batch_selector')
|
||||||
|
.then((value) => {
|
||||||
|
if (value) {
|
||||||
|
frappe.flags.hide_serial_batch_dialog = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
if(show_batch_dialog && !frappe.flags.hide_serial_batch_dialog) {
|
if(show_batch_dialog && !frappe.flags.hide_serial_batch_dialog) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"action_if_quality_inspection_is_not_submitted",
|
"action_if_quality_inspection_is_not_submitted",
|
||||||
"show_barcode_field",
|
"show_barcode_field",
|
||||||
"clean_description_html",
|
"clean_description_html",
|
||||||
|
"disable_serial_no_and_batch_selector",
|
||||||
"section_break_7",
|
"section_break_7",
|
||||||
"auto_insert_price_list_rate_if_missing",
|
"auto_insert_price_list_rate_if_missing",
|
||||||
"allow_negative_stock",
|
"allow_negative_stock",
|
||||||
@ -227,6 +228,12 @@
|
|||||||
"fieldname": "control_historical_stock_transactions_section",
|
"fieldname": "control_historical_stock_transactions_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Control Historical Stock Transactions"
|
"label": "Control Historical Stock Transactions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "disable_serial_no_and_batch_selector",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Disable Serial No And Batch Selector"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
@ -234,7 +241,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-12-29 12:53:31.162247",
|
"modified": "2021-01-18 13:15:38.352796",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Stock Settings",
|
"name": "Stock Settings",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user