Merge pull request #30527 from rohitwaghchaure/feat-pick-list-item-reference-in-delivery-note

feat: minor, pick list item reference on delivery note item table
This commit is contained in:
rohitwaghchaure 2022-03-31 20:22:49 +05:30 committed by GitHub
commit 8d16c7f44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -74,6 +74,7 @@
"against_sales_invoice", "against_sales_invoice",
"si_detail", "si_detail",
"dn_detail", "dn_detail",
"pick_list_item",
"section_break_40", "section_break_40",
"batch_no", "batch_no",
"serial_no", "serial_no",
@ -762,13 +763,22 @@
"fieldtype": "Check", "fieldtype": "Check",
"label": "Grant Commission", "label": "Grant Commission",
"read_only": 1 "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, "idx": 1,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2022-02-24 14:42:20.211085", "modified": "2022-03-31 18:36:24.671913",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Delivery Note Item", "name": "Delivery Note Item",

View File

@ -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) dn_item = map_child_doc(source_doc, delivery_note, table_mapper)
if dn_item: if dn_item:
dn_item.pick_list_item = location.name
dn_item.warehouse = location.warehouse dn_item.warehouse = location.warehouse
dn_item.qty = flt(location.picked_qty) / (flt(location.conversion_factor) or 1) dn_item.qty = flt(location.picked_qty) / (flt(location.conversion_factor) or 1)
dn_item.batch_no = location.batch_no dn_item.batch_no = location.batch_no

View File

@ -521,6 +521,8 @@ class TestPickList(FrappeTestCase):
for dn_item in frappe.get_doc("Delivery Note", dn.name).get("items"): 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.item_code, "_Test Item")
self.assertEqual(dn_item.against_sales_order, sales_order_1.name) 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( for dn in frappe.get_all(
"Delivery Note", "Delivery Note",
filters={"pick_list": pick_list.name, "customer": "_Test Customer 1"}, filters={"pick_list": pick_list.name, "customer": "_Test Customer 1"},