From 380dd730650a8512c0d7ce485357ed9301ce9a6a Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Thu, 27 Apr 2023 18:37:32 +0530 Subject: [PATCH] fix: map `Packed Items` while creating `Packing Slip` --- .../doctype/delivery_note/delivery_note.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 9f6dd24fa6c0..f477e3529262 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -698,8 +698,27 @@ def make_packing_slip(source_name, target_doc=None): "field_map": { "item_code": "item_code", "item_name": "item_name", + "batch_no": "batch_no", + "description": "description", + "qty": "qty", + "total_weight": "net_weight", + "stock_uom": "stock_uom", + "weight_uom": "weight_uom", + "name": "dn_detail", + }, + "condition": lambda doc: not frappe.db.exists( + "Product Bundle", {"new_item_code": doc.item_code} + ), + }, + "Packed Item": { + "doctype": "Packing Slip Item", + "field_map": { + "item_code": "item_code", + "item_name": "item_name", + "batch_no": "batch_no", "description": "description", "qty": "qty", + "name": "pi_detail", }, }, },