From 79ee1ae3d247e3a167c718065b4b75c4e71ba8d5 Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Fri, 2 Jul 2021 14:36:08 +0000 Subject: [PATCH] [FIX] stock: use the same editable view for inventories and products This commit makes sure the same view is used between the "inventory adjustments" menu and the " update quantity" button in the product form. The two views should always keep the same fields and buttons. Task : 2555118 Part-of: odoo/odoo#74715 --- addons/stock/models/product.py | 3 ++- addons/stock/views/stock_quant_views.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 2f051040c2c..a49ab7ef607 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -539,7 +539,8 @@ class Product(models.Model): ) else: self = self.with_context(product_tmpl_ids=self.product_tmpl_id.ids) - action = self.env['stock.quant']._get_quants_action(domain) + action = self.env['stock.quant'].action_view_inventory() + action['domain'] = domain action["name"] = _('Update Quantity') return action diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml index ccbbf797d2b..06068db9c70 100644 --- a/addons/stock/views/stock_quant_views.xml +++ b/addons/stock/views/stock_quant_views.xml @@ -353,7 +353,7 @@ - +