From 0d2e2801521dcac9ee66dc2c4b723c4aa895a947 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 8 Jan 2020 13:16:48 +0000 Subject: [PATCH] [FIX] stock: update quantity when products are grouped - Go Inventory > Master Data > Products - Group by Category - Go to a product - Click on 'Update Inventory' An error is raised because the field `categ_id` doesn't exist on `stock.quant`. opw-2161129 closes odoo/odoo#42964 X-original-commit: 901d60cd90f1e6ba0fd6502c04619193d3ca1c7b Signed-off-by: Nicolas Martinelli (nim) --- addons/stock/models/stock_quant.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 3a9f269c292..005a2d68f57 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -617,13 +617,15 @@ class StockQuant(models.Model): :param extend: If True, enables form, graph and pivot views. False by default. """ self._quant_tasks() + ctx = dict(self.env.context or {}) + ctx.pop('group_by', None) action = { 'name': _('Update Quantity'), 'view_type': 'tree', 'view_mode': 'list', 'res_model': 'stock.quant', 'type': 'ir.actions.act_window', - 'context': self.env.context, + 'context': ctx, 'domain': domain or [], 'help': """

No Stock On Hand