summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2019-11-15 15:00:30 +0000
committerSimon Lejeune <sle@openerp.com>2019-12-04 10:40:00 +0000
commit53658052ae653a5e4e12c07dc459bb621365d2f5 (patch)
treee51f955b11a13e052f1b58d91479539ab56436fb
parent4afba9ee68918882259bd26bd07003bce0ddb3a3 (diff)
[REF] stock: forecast report and quants not below a warehouse
On a quotation, the forecast report is opened with a default filter on the warehouse of the quotation. If you remove this filter, quantities not below warehouses (eg in subcontracting or in a repair location) are displayed. From the product form, it's not the case, you never see these quantities. We now add a "warehouse is set" filter that is enabled by default (so you have the same value in the stat button forecast and in opening the report) but you can remove it to see all quantities. task-2061825
-rw-r--r--addons/sale_stock/static/src/js/qty_at_date_widget.js1
-rw-r--r--addons/stock/models/product.py2
-rw-r--r--addons/stock/report/report_stock_quantity.xml5
3 files changed, 5 insertions, 3 deletions
diff --git a/addons/sale_stock/static/src/js/qty_at_date_widget.js b/addons/sale_stock/static/src/js/qty_at_date_widget.js
index df3d60e8002..57762828cdc 100644
--- a/addons/sale_stock/static/src/js/qty_at_date_widget.js
+++ b/addons/sale_stock/static/src/js/qty_at_date_widget.js
@@ -83,6 +83,7 @@ var QtyAtDateWidget = Widget.extend({
var additional_context = {};
additional_context.grid_anchor = self.data.delivery_date_grid;
additional_context.search_default_warehouse_id = [self.data.warehouse_id.data.id];
+ additional_context.search_default_below_warehouse = false;
action.context = new Context(action.context, additional_context);
action.domain = [
['product_id', 'in', res]
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index 756b1f9bf6d..2b8e1de076c 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -517,7 +517,6 @@ class Product(models.Model):
action = self.env.ref('stock.report_stock_quantity_action_product').read()[0]
action['domain'] = [
('product_id', '=', self.id),
- ('warehouse_id', '!=', False),
]
return action
@@ -793,7 +792,6 @@ class ProductTemplate(models.Model):
action = self.env.ref('stock.report_stock_quantity_action_product').read()[0]
action['domain'] = [
('product_id', 'in', self.product_variant_ids.ids),
- ('warehouse_id', '!=', False),
]
return action
diff --git a/addons/stock/report/report_stock_quantity.xml b/addons/stock/report/report_stock_quantity.xml
index 868f9552105..81ec015759b 100644
--- a/addons/stock/report/report_stock_quantity.xml
+++ b/addons/stock/report/report_stock_quantity.xml
@@ -26,6 +26,8 @@
<filter string="Forecasted Receipts" name="filter_in" domain="[('state', '=', 'in')]"/>
<filter string="Forecasted Deliveries" name="filter_out" domain="[('state', '=', 'out')]"/>
<filter string="Date" name="filter_date" date="date"/>
+ <separator/>
+ <filter string="Warehouse is set" name="below_warehouse" domain="[('warehouse_id', '!=', False)]"/>
</group>
<group expand="0" string="Group By">
<filter string="Date" name="groupby_date" domain="[]" context="{'group_by':'date:day'}"/>
@@ -40,6 +42,7 @@
<field name="view_mode">graph</field>
<field name="context">{
'search_default_filter_forecast': 1,
+ 'search_default_below_warehouse': 1,
'graph_groupbys': ['date:day', 'state', 'product_id'],
}</field>
</record>
@@ -48,9 +51,9 @@
<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,
+ 'search_default_below_warehouse': 1,
'graph_groupbys': ['date:day', 'state', 'product_id'],
}</field>
</record>