diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index 5fa1a87e924..4ca409e225e 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -511,7 +511,10 @@ class Product(models.Model):
def action_product_forecast_report(self):
action = self.env.ref('stock.report_stock_quantity_action_product').read()[0]
- action['domain'] = [('product_id', '=', self.id)]
+ action['domain'] = [
+ ('product_id', '=', self.id),
+ ('warehouse_id', '!=', False),
+ ]
return action
@api.model
@@ -779,7 +782,10 @@ class ProductTemplate(models.Model):
def action_product_tmpl_forecast_report(self):
action = self.env.ref('stock.report_stock_quantity_action').read()[0]
- action['domain'] = [('product_id', 'in', self.product_variant_ids.ids)]
+ action['domain'] = [
+ ('product_id', 'in', self.product_variant_ids.ids),
+ ('warehouse_id', '!=', False),
+ ]
return action
class ProductCategory(models.Model):
diff --git a/addons/stock/report/report_stock_quantity.xml b/addons/stock/report/report_stock_quantity.xml
index f9a2e1c00bb..868f9552105 100644
--- a/addons/stock/report/report_stock_quantity.xml
+++ b/addons/stock/report/report_stock_quantity.xml
@@ -48,6 +48,7 @@
Forecasted Inventory
report.stock.quantity
graph
+ [('warehouse_id', '!=', False)]
{
'search_default_filter_forecast': 1,
'graph_groupbys': ['date:day', 'state', 'product_id'],