[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-01-09 12:29:28 +00:00
parent e7349beb06
commit 0d2e280152
+3 -1
View File
@@ -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': """
<p class="o_view_nocontent_empty_folder">No Stock On Hand</p>