From e61a3bc15a9941b021f950873cacc87e270770fb Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 25 Jun 2020 08:28:22 +0000 Subject: [PATCH] [IMP] stock: keep coherant action name At bee938e (following task-id 2042303), the label of the action was changed globaly. The action is however shared with multiple menus like Inventory Report. The Update Quantity label only makes sense when coming from the product where the quantity will be updated. Closes odoo/odoo#50523 --- addons/stock/models/product.py | 4 +++- addons/stock/models/stock_quant.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 7118178bddc..5a011fda192 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -500,7 +500,9 @@ class Product(models.Model): ) else: self = self.with_context(product_tmpl_id=self.product_tmpl_id.id) - return self.env['stock.quant']._get_quants_action(domain) + action = self.env['stock.quant']._get_quants_action(domain) + action["name"] = _('Update Quantity') + return action def action_update_quantity_on_hand(self): return self.product_tmpl_id.with_context(default_product_id=self.id).action_update_quantity_on_hand() diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index d1fbd37b952..faab239973c 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -605,7 +605,7 @@ class StockQuant(models.Model): ctx = dict(self.env.context or {}) ctx.pop('group_by', None) action = { - 'name': _('Update Quantity'), + 'name': _('Stock On Hand'), 'view_type': 'tree', 'view_mode': 'list', 'res_model': 'stock.quant',