Skip to content

Commit

Permalink
Merge pull request #30527 from rohitwaghchaure/feat-pick-list-item-re…
Browse files Browse the repository at this point in the history
…ference-in-delivery-note

feat: minor, pick list item reference on delivery note item table
  • Loading branch information
rohitwaghchaure authored Mar 31, 2022
2 parents 02dab02 + 2f51011 commit 8d16c7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"against_sales_invoice",
"si_detail",
"dn_detail",
"pick_list_item",
"section_break_40",
"batch_no",
"serial_no",
Expand Down Expand Up @@ -762,13 +763,22 @@
"fieldtype": "Check",
"label": "Grant Commission",
"read_only": 1
},
{
"fieldname": "pick_list_item",
"fieldtype": "Data",
"hidden": 1,
"label": "Pick List Item",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-02-24 14:42:20.211085",
"modified": "2022-03-31 18:36:24.671913",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
Expand Down
1 change: 1 addition & 0 deletions erpnext/stock/doctype/pick_list/pick_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ def map_pl_locations(pick_list, item_mapper, delivery_note, sales_order=None):
dn_item = map_child_doc(source_doc, delivery_note, table_mapper)

if dn_item:
dn_item.pick_list_item = location.name
dn_item.warehouse = location.warehouse
dn_item.qty = flt(location.picked_qty) / (flt(location.conversion_factor) or 1)
dn_item.batch_no = location.batch_no
Expand Down
2 changes: 2 additions & 0 deletions erpnext/stock/doctype/pick_list/test_pick_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ def test_multiple_dn_creation(self):
for dn_item in frappe.get_doc("Delivery Note", dn.name).get("items"):
self.assertEqual(dn_item.item_code, "_Test Item")
self.assertEqual(dn_item.against_sales_order, sales_order_1.name)
self.assertEqual(dn_item.pick_list_item, pick_list.locations[dn_item.idx - 1].name)

for dn in frappe.get_all(
"Delivery Note",
filters={"pick_list": pick_list.name, "customer": "_Test Customer 1"},
Expand Down

0 comments on commit 8d16c7f

Please sign in to comment.