[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user