fix: serial no is mandatory for zero qty validation
This commit is contained in:
@@ -262,6 +262,11 @@ frappe.ui.form.on("Stock Reconciliation Item", {
|
||||
|
||||
qty: function (frm, cdt, cdn) {
|
||||
frm.events.set_amount_quantity(frm, cdt, cdn);
|
||||
|
||||
let row = locals[cdt][cdn];
|
||||
if (!row.qty) {
|
||||
frappe.model.set_value(cdt, cdn, "serial_no", "");
|
||||
}
|
||||
},
|
||||
|
||||
valuation_rate: function (frm, cdt, cdn) {
|
||||
|
||||
@@ -250,7 +250,7 @@ class StockReconciliation(StockController):
|
||||
validate_is_stock_item(item_code, item.is_stock_item)
|
||||
|
||||
# item should not be serialized
|
||||
if item.has_serial_no and not row.serial_no and not item.serial_no_series:
|
||||
if item.has_serial_no and row.qty and not row.serial_no and not item.serial_no_series:
|
||||
raise frappe.ValidationError(
|
||||
_("Serial no(s) required for serialized item {0}").format(item_code)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user