diff options
| author | Simon Lejeune <sle@openerp.com> | 2019-12-04 12:39:36 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2019-12-04 12:49:25 +0000 |
| commit | 0e4e21a1e7a0aba90263a2978c3e0a8049de05a0 (patch) | |
| tree | 377f2fdccc0f2eeabc8b7451fc237686c84ec3ac /addons | |
| parent | 447cc7b88c0d99820263cc1a6bbec8256a51aef0 (diff) | |
[REF] stock: remove quantity_available_locations_domain context key
- we would have to set this domain on every actions directing to
products
-we can't set a proper depends_context since the new orm doesn't support
it
closes odoo/odoo#41322
Related: odoo/enterprise#7033
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons')
| -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> |
