diff options
| -rw-r--r-- | addons/stock/models/product.py | 7 | ||||
| -rw-r--r-- | addons/stock/views/product_views.xml | 6 |
2 files changed, 2 insertions, 11 deletions
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 65238e28e9e..61a4313ce12 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -289,13 +289,8 @@ class Product(models.Model): loc_domain = loc_domain + [('location_id', operator, other_locations.ids)] dest_loc_domain = dest_loc_domain and ['|'] + dest_loc_domain or dest_loc_domain dest_loc_domain = dest_loc_domain + [('location_dest_id', operator, other_locations.ids)] - usage = self._context.get('quantity_available_locations_domain') - if usage: - stock_loc_domain = expression.AND([domain + loc_domain, [('location_id.usage', 'in', usage)]]) - else: - stock_loc_domain = domain + loc_domain return ( - stock_loc_domain, + domain + loc_domain, domain + dest_loc_domain + ['!'] + loc_domain if loc_domain else domain + dest_loc_domain, domain + loc_domain + ['!'] + dest_loc_domain if dest_loc_domain else domain + loc_domain ) diff --git a/addons/stock/views/product_views.xml b/addons/stock/views/product_views.xml index dbdded557d6..ec254bee0bf 100644 --- a/addons/stock/views/product_views.xml +++ b/addons/stock/views/product_views.xml @@ -278,9 +278,6 @@ attrs="{'invisible': [('type', '=', 'service')]}" context="{'invisible_handle': True, 'single_product': True}"/> </div> - <xpath expr="//field[@name='product_tmpl_id']" position="attributes"> - <attribute name="context">{'quantity_available_locations_domain': ('internal',)}</attribute> - </xpath> </data> </field> </record> @@ -394,7 +391,7 @@ <field name="res_model">product.template</field> <field name="view_mode">kanban,tree,form</field> <field name="search_view_id" ref="product_template_search_form_view_stock"/> - <field name="context">{"search_default_consumable": 1, 'default_type': 'product', 'quantity_available_locations_domain': ('internal',)}</field> + <field name="context">{"search_default_consumable": 1, 'default_type': 'product'}</field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Create a new product @@ -407,7 +404,6 @@ <field name="type">ir.actions.act_window</field> <field name="res_model">product.product</field> <field name="view_mode">tree,form,kanban</field> - <field name="context">{'quantity_available_locations_domain': ('internal',)}</field> <field name="search_view_id" ref="stock_product_search_form_view"/> </record> |
