From 5b04d82883e327433ef7211f1cfd5b9903f353ec Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 9 Aug 2024 12:45:53 +0530 Subject: [PATCH] fix: delivery note creation issue (#42696) --- erpnext/stock/doctype/delivery_note/delivery_note.py | 3 +++ erpnext/stock/doctype/pick_list/pick_list.py | 1 + 2 files changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ea83475c56..93270ea362 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -320,6 +320,9 @@ class DeliveryNote(SellingController): return for item in self.items: + if item.use_serial_batch_fields: + continue + if item.pick_list_item and not item.serial_and_batch_bundle: filters = { "item_code": item.item_code, diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 631d342ad9..c1bac92faf 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -1190,6 +1190,7 @@ def map_pl_locations(pick_list, item_mapper, delivery_note, sales_order=None): dn_item.qty = flt(location.picked_qty) / (flt(location.conversion_factor) or 1) dn_item.batch_no = location.batch_no dn_item.serial_no = location.serial_no + dn_item.use_serial_batch_fields = location.use_serial_batch_fields update_delivery_note_item(source_doc, dn_item, delivery_note) -- GitLab