fix: added validation for insufficient stock during stock transfer

This commit is contained in:
Rohit Waghchaure
2023-06-05 16:56:29 +05:30
parent b1ef19a0cd
commit dcb0462d51
3 changed files with 37 additions and 17 deletions

View File

@@ -68,6 +68,26 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
}
});
if (this.frm.doc.doctype === 'Stock Entry'
&& this.frm.doc.purpose === 'Manufacture') {
fields.push({
fieldtype: 'Column Break',
});
fields.push({
fieldtype: 'Link',
fieldname: 'work_order',
label: __('For Work Order'),
options: 'Work Order',
read_only: 1,
default: this.frm.doc.work_order,
});
fields.push({
fieldtype: 'Section Break',
});
}
fields.push({
fieldtype: 'Column Break',
});
@@ -101,22 +121,6 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
});
}
if (this.frm.doc.doctype === 'Stock Entry'
&& this.frm.doc.purpose === 'Manufacture') {
fields.push({
fieldtype: 'Column Break',
});
fields.push({
fieldtype: 'Link',
fieldname: 'work_order',
label: __('For Work Order'),
options: 'Work Order',
read_only: 1,
default: this.frm.doc.work_order,
});
}
if (this.item?.outward) {
fields = [...this.get_filter_fields(), ...fields];
} else {