Allow Default Warehouse for Item, even if not a Stock Item
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 88109bb..45b4232 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -175,7 +175,7 @@
"reqd": 1
},
{
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "depends_on": "",
"description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.",
"fieldname": "default_warehouse",
"fieldtype": "Link",
@@ -825,7 +825,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
- "modified": "2014-07-03 10:45:19.574737",
+ "modified": "2014-08-18 09:32:57.268763",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py
index f04625b..9263907 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.py
+++ b/erpnext/stock/doctype/packed_item/packed_item.py
@@ -67,12 +67,10 @@
packing_list_idx = 0
parent_items = []
for d in obj.get(item_table_fieldname):
- warehouse = (item_table_fieldname == "sales_order_details") \
- and d.warehouse or d.warehouse
if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}):
for i in get_sales_bom_items(d.item_code):
update_packing_list_item(obj, i['item_code'], flt(i['qty'])*flt(d.qty),
- warehouse, d, packing_list_idx)
+ d.warehouse, d, packing_list_idx)
if [d.item_code, d.name] not in parent_items:
parent_items.append([d.item_code, d.name])