diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 9a2da9620c..43f7cdd0fc 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -171,9 +171,6 @@ class SellingController(StockController): frappe.throw(_("Row {0}: Qty is mandatory").format(d.idx)) if self.doctype == "Sales Order": - if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or - self.has_sales_bom(d.item_code)) and not d.warehouse: - frappe.throw(_("Reserved Warehouse required for stock Item {0} in row {1}").format(d.item_code, d.idx)) reserved_warehouse = d.warehouse if flt(d.qty) > flt(d.delivered_qty): reserved_qty_for_main_item = flt(d.qty) - flt(d.delivered_qty) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index feffc4feb0..7d5b2ac61d 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -39,8 +39,8 @@ class SalesOrder(SellingController): for d in self.get('items'): check_list.append(cstr(d.item_code)) - if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes': - if not d.warehouse: + if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or + self.has_sales_bom(d.item_code)) and not d.warehouse: frappe.throw(_("Reserved warehouse required for stock item {0}").format(d.item_code)) # used for production plan