diff --git a/move.py b/move.py
index d58b08abb7..48acfbaac5 100644
--- a/move.py
+++ b/move.py
@@ -111,10 +111,6 @@ class StockMixin(object):
Compute the domain to filter records which validates the domain over
quantity field.
- The context with keys:
- stock_skip_warehouse: if set, quantities on a warehouse are no more
- quantities of all child locations but quantities of the storage
- zone.
location_ids is the list of IDs of locations to take account to compute
the stock.
grouping defines how stock moves are grouped.
@@ -956,9 +952,6 @@ class Move(Workflow, ModelSQL, ModelView):
forecast: if set compute the forecast quantity.
stock_destinations: A list of location ids. If set, restrict the
computation to moves from and to those locations.
- stock_skip_warehouse: if set, quantities on a warehouse are no more
- quantities of all child locations but quantities of the storage
- zone.
If with_childs, it computes also for child locations.
grouping is a tuple of Move (or Product if prefixed by 'product.')
field names and defines how stock moves are grouped.
diff --git a/product.py b/product.py
index 049d3b527f..ea913aea4f 100644
--- a/product.py
+++ b/product.py
@@ -564,12 +564,19 @@ class ProductQuantitiesByWarehouseContext(ModelView):
('type', '=', 'warehouse'),
],
help="The warehouse for which the quantities will be calculated.")
+ stock_skip_warehouse = fields.Boolean(
+ "Only storage zone",
+ help="Check to use only the quantity of the storage zone.")
@classmethod
def default_warehouse(cls):
Location = Pool().get('stock.location')
return Location.get_default_warehouse()
+ @classmethod
+ def default_stock_skip_warehouse(cls):
+ return Transaction().context.get('stock_skip_warehouse')
+
class OpenProductQuantitiesByWarehouse(Wizard):
"Open Product Quantities By Warehouse"
diff --git a/product.xml b/product.xml
index a3be82872f..3b5273d07a 100644
--- a/product.xml
+++ b/product.xml
@@ -152,7 +152,7 @@ this repository contains the full copyright notices and license terms. -->
stock.location
+ eval="If(Eval('active_model') == 'product.template', {'product_template': Eval('active_id'), 'stock_skip_warehouse': False}, {'product': Eval('active_id'), 'stock_skip_warehouse': False})"/>
product.by_location.context
@@ -189,7 +189,7 @@ this repository contains the full copyright notices and license terms. -->
stock.location
+ eval="If(Eval('active_model') == 'product.template', {'product_template': Eval('active_id'), 'with_childs': False, 'stock_skip_warehouse': False}, {'product': Eval('active_id'), 'with_childs': False, 'stock_skip_warehouse': False})"/>
product.by_location.context
diff --git a/view/product_quantities_warehouse_context_form.xml b/view/product_quantities_warehouse_context_form.xml
index 7e73ad75e1..ec773c860c 100644
--- a/view/product_quantities_warehouse_context_form.xml
+++ b/view/product_quantities_warehouse_context_form.xml
@@ -4,4 +4,6 @@ this repository contains the full copyright notices and license terms. -->