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:
Deepesh Garg
2021-01-28 12:09:35 +05:30
committed by GitHub
parent bd9bdc5797
commit 16bcd01f6d
2 changed files with 19 additions and 2 deletions

View File

@@ -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"])
.then((r) => {
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;
}
});
},
() => {
// 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) {
var d = locals[cdt][cdn];