Fixes in Default Warehouse
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index cf02a3a..00eac9a 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -12,12 +12,12 @@
"actual_start_date": "",
"actual_end_date": ""
});
+ erpnext.production_order.set_default_warehouse(frm);
}
erpnext.production_order.set_custom_buttons(frm);
erpnext.production_order.setup_company_filter(frm);
erpnext.production_order.setup_bom_filter(frm);
- erpnext.production_order.set_default_warehouse(frm);
});
frappe.ui.form.on("Production Order", "refresh", function(frm) {
@@ -147,8 +147,8 @@
callback: function(r) {
if(!r.exe) {
- frm.set_value("wip_warehouse", r.message[0]);
- frm.set_value("fg_warehouse", r.message[1])
+ frm.set_value("wip_warehouse", r.message.wip_warehouse);
+ frm.set_value("fg_warehouse", r.message.fg_warehouse)
}
}
});
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 182f306..6299736 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -427,4 +427,4 @@
def get_default_warehouse():
wip_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_wip_warehouse")
fg_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_fg_warehouse")
- return wip_warehouse, fg_warehouse
\ No newline at end of file
+ return {"wip_warehouse": wip_warehouse, "fg_warehouse": fg_warehouse}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index 3f08b1b..254b5a5 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -208,9 +208,11 @@
pro.update(items[key])
pro.set_production_order_operations()
if warehouse:
- pro.wip_warehouse = warehouse[0]
- pro.fg_warehouse = warehouse[1]
+ pro.wip_warehouse = warehouse.get('wip_warehouse')
+ if not pro.fg_warehouse:
+ pro.fg_warehouse = warehouse.get('fg_warehouse')
frappe.flags.mute_messages = True
+
try:
pro.insert()
pro_list.append(pro.name)
@@ -218,7 +220,6 @@
pass
frappe.flags.mute_messages = False
-
return pro_list
def download_raw_materials(self):