From c278d99f8909b57db6c819bcd6693bde99a73930 Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 10 Dec 2019 13:09:26 +0000 Subject: [PATCH] [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. --- addons/stock/models/stock_quant.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 475071a1c23..3a9f269c292 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -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