summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/product.py9
-rw-r--r--addons/stock/views/product_views.xml4
2 files changed, 6 insertions, 7 deletions
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index 5e3de7f0443..01c4f989676 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -490,11 +490,10 @@ class ProductTemplate(models.Model):
outgoing_qty = fields.Float(
'Outgoing', compute='_compute_quantities', search='_search_outgoing_qty',
digits=dp.get_precision('Product Unit of Measure'))
- # The goal of these fields is not to be able to search a location_id/warehouse_id but
- # to properly make these fields "dummy": only used to put some keys in context from
- # the search view in order to influence computed field
- location_id = fields.Many2one('stock.location', 'Location', store=False, search=lambda operator, operand, vals: [])
- warehouse_id = fields.Many2one('stock.warehouse', 'Warehouse', store=False, search=lambda operator, operand, vals: [])
+ # The goal of these fields is to be able to put some keys in context from search view in order
+ # to influence computed field.
+ location_id = fields.Many2one('stock.location', 'Location', store=False)
+ warehouse_id = fields.Many2one('stock.warehouse', 'Warehouse', store=False)
route_ids = fields.Many2many(
'stock.location.route', 'stock_route_product', 'product_id', 'route_id', 'Routes',
domain=[('product_selectable', '=', True)],
diff --git a/addons/stock/views/product_views.xml b/addons/stock/views/product_views.xml
index 64be1d7a250..17a347594cc 100644
--- a/addons/stock/views/product_views.xml
+++ b/addons/stock/views/product_views.xml
@@ -73,8 +73,8 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='pricelist_id']" position="after">
<separator/>
- <field name="location_id" context="{'location': self}"/>
- <field name="warehouse_id" context="{'warehouse': self}"/>
+ <field name="location_id" context="{'location': self}" filter_domain="[]"/>
+ <field name="warehouse_id" context="{'warehouse': self}" filter_domain="[]"/>
<separator/>
<filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
<filter name="real_stock_negative" string="Negative Forecasted Quantity" domain="[('virtual_available','&lt;',0)]"/>