fix: Remove "Material Issue" purpose from pick list
- Because in material issue we already define source warehouse
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index feaa413..1027dd5 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -67,7 +67,6 @@
}
if (frm.doc.material_request_type === "Material Issue") {
- add_create_pick_list_button();
frm.add_custom_button(__("Issue Material"),
() => frm.events.make_stock_entry(frm), __('Create'));
}
diff --git a/erpnext/stock/doctype/pick_list/pick_list.json b/erpnext/stock/doctype/pick_list/pick_list.json
index dbfd7d1..c7aa458 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.json
+++ b/erpnext/stock/doctype/pick_list/pick_list.json
@@ -98,7 +98,7 @@
"fieldname": "purpose",
"fieldtype": "Select",
"label": "Purpose",
- "options": "Material Transfer for Manufacture\nMaterial Issue\nMaterial Transfer\nDelivery against Sales Order"
+ "options": "Material Transfer for Manufacture\nMaterial Transfer\nDelivery against Sales Order"
},
{
"depends_on": "eval:['Material Transfer', 'Material Issue'].includes(doc.purpose)",
@@ -115,7 +115,7 @@
}
],
"is_submittable": 1,
- "modified": "2019-08-26 06:52:04.532885",
+ "modified": "2019-08-26 16:11:03.184637",
"modified_by": "Administrator",
"module": "Stock",
"name": "Pick List",
diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py
index 16bb9e6..d5bf643 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.py
+++ b/erpnext/stock/doctype/pick_list/pick_list.py
@@ -359,9 +359,14 @@
def update_stock_entry_based_on_material_request(pick_list, stock_entry):
for location in pick_list.locations:
+ target_warehouse = None
+ if location.material_request_item:
+ target_warehouse = frappe.get_value('Material Request Item',
+ location.material_request_item, 'warehouse')
item = frappe._dict()
item.item_code = location.item_code
item.s_warehouse = location.warehouse
+ item.t_warehouse = target_warehouse
item.qty = location.qty
item.transfer_qty = location.stock_qty
item.uom = location.uom