Merge pull request #20565 from vishdha/filter_serial_based_on_batch_v13
fix: filter serial no based on batch no
This commit is contained in:
commit
65a53ba86c
@ -90,7 +90,8 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
args: {
|
args: {
|
||||||
qty: qty,
|
qty: qty,
|
||||||
item_code: me.item_code,
|
item_code: me.item_code,
|
||||||
warehouse: me.warehouse_details.name
|
warehouse: me.warehouse_details.name,
|
||||||
|
batch_no: me.item.batch_no || null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -392,7 +393,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
delivery_document_no: ""
|
delivery_document_no: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.has_batch) {
|
if (this.item.batch_no) {
|
||||||
serial_no_filters["batch_no"] = this.item.batch_no;
|
serial_no_filters["batch_no"] = this.item.batch_no;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,6 @@ def make_serial_no(serial_no, args):
|
|||||||
sr.asset = args.get('asset')
|
sr.asset = args.get('asset')
|
||||||
sr.location = args.get('location')
|
sr.location = args.get('location')
|
||||||
|
|
||||||
|
|
||||||
if args.get('purchase_document_type'):
|
if args.get('purchase_document_type'):
|
||||||
sr.purchase_document_type = args.get('purchase_document_type')
|
sr.purchase_document_type = args.get('purchase_document_type')
|
||||||
sr.purchase_document_no = args.get('purchase_document_no')
|
sr.purchase_document_no = args.get('purchase_document_no')
|
||||||
@ -494,10 +493,11 @@ def get_delivery_note_serial_no(item_code, qty, delivery_note):
|
|||||||
return serial_nos
|
return serial_nos
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def auto_fetch_serial_number(qty, item_code, warehouse):
|
def auto_fetch_serial_number(qty, item_code, warehouse, batch_no=None):
|
||||||
serial_numbers = frappe.get_list("Serial No", filters={
|
serial_numbers = frappe.get_list("Serial No", filters={
|
||||||
"item_code": item_code,
|
"item_code": item_code,
|
||||||
"warehouse": warehouse,
|
"warehouse": warehouse,
|
||||||
|
"batch_no": batch_no,
|
||||||
"delivery_document_no": "",
|
"delivery_document_no": "",
|
||||||
"sales_invoice": ""
|
"sales_invoice": ""
|
||||||
}, limit=qty, order_by="creation")
|
}, limit=qty, order_by="creation")
|
||||||
|
Loading…
Reference in New Issue
Block a user