[FIX] stock: traceback when trying to update quantity on hand

When accessing the quantities on hand of a product, `_get_quants_action`
is called to specify the action returned.

In some cases, the action context may be updated.  This led to a
traceback because the context of the action isn't a copy of the current
context but a link to the current context frozendict, which cannot be
updated.
This commit is contained in:
Victor Feyens
2019-12-10 13:26:47 +00:00
parent 6d6b3479cf
commit c278d99f89
+1 -4
View File
@@ -640,10 +640,7 @@ class StockQuant(models.Model):
('company_id', '=', self.env.company.id),
('location_id.usage', 'in', ['internal', 'transit'])
]):
action['context'].update({
'search_default_productgroup': 0,
'search_default_locationgroup': 0
})
action['context'] = dict(action['context'], search_default_productgroup=0, search_default_locationgroup=0)
else:
action['view_id'] = self.env.ref('stock.view_stock_quant_tree').id
# Enables form view in readonly list