diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 5fa1a87e9242748f5bb11bdc8f57547a0d053c67..4ca409e225e2d3ed0250fd19da52526b90eaceaf 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 f9a2e1c00bb135eedded87d379a40f45ce06fd12..868f9552105b11ae7c2be1364536ecb4c0f6df1b 100644 --- a/addons/stock/report/report_stock_quantity.xml +++ b/addons/stock/report/report_stock_quantity.xml @@ -48,6 +48,7 @@ <field name="name">Forecasted Inventory</field> <field name="res_model">report.stock.quantity</field> <field name="view_mode">graph</field> + <field name="domain">[('warehouse_id', '!=', False)]</field> <field name="context">{ 'search_default_filter_forecast': 1, 'graph_groupbys': ['date:day', 'state', 'product_id'],