From 4da161244d70da1008625de75c8694696b7a55ed Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 17 Jan 2019 13:00:47 +0000 Subject: [PATCH] [FIX] stock_account: ctx after group by - Set valuation to FIFO - Make a PO for a product - Validate the picking - Execute the Inventory Valuation report - Apply group by Category - Click on the 'Valuation' info button A traceback occurs because of the usual `group_by` context key which is kept. opw-1918915 closes odoo/odoo#30313 --- addons/stock_account/models/product.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index dcd197489fb..b035a23ec2b 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -249,12 +249,14 @@ class ProductProduct(models.Model): """ self.ensure_one() to_date = self.env.context.get('to_date') + ctx = self.env.context.copy() + ctx.pop('group_by', None) action = { 'name': _('Valuation at date'), 'type': 'ir.actions.act_window', 'view_type': 'form', 'view_mode': 'tree,form', - 'context': self.env.context, + 'context': ctx, } if self.valuation == 'real_time': action['res_model'] = 'account.move.line'