I created a new bundle named ’ SAC0044 New Bundle’ and this is not a stock item. So ‘maintain stock’ is unchecked. Added two regular items to the bundle and both of the items had their warehouse set and there was a stock balance of 10 for each item in their warehouse.
Created a sales order adding 2 quantity of ‘SAC0044 New Bundle’. When I try to save the sales order it says ‘Delivery warehouse required for stock item SAC0044 New Bundle’.
This looks like a bug to me since bundle should not be a stock item.
Though Product Bundle is not a stock item, you will have to select Warehouse for it in transaction. This is proabably because in the Item master, Warehouse is not a mandatory field. Hence you might have stock items for which Warehouse is not defined.
For suggestion for fetching warehouse in stock item from respective item masters, please create Github Issue.
for d in self.get("items"):
if (frappe.db.get_value("Item", d.item_code, "is_stock_item")==1 or
(self.has_product_bundle(d.item_code) and self.product_bundle_has_stock_item(d.item_code))) \
and not d.warehouse and not cint(d.delivered_by_supplier):
frappe.throw(_("Delivery warehouse required for stock item {0}").format(d.item_code),
WarehouseRequired)
I agree, in my particular case, I opted for direct modification of the actual Bundle Item in the tabItem table, by directly inserting into defalut_warehouse the correct warehouse, and the problem was solved.
However this should be automatically validated in “non-stock” items when the default warehouse is updated in Stock Settings. I will setup an issue on GitHub for this.