From d5ba35cb7cd2cebbd53b11cbd8b9c73808e88ad5 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 19 Jun 2020 08:32:51 +0000 Subject: [PATCH] [FIX] sale_timesheet: clean context - Modify `timesheet_action_all` to display the tree view before the grid view - In the quotation tree view, order by Status, group by Salesman and save as filter - Open a SO with timesheets - Clck on the 'Timesheets' stat button An error occurs because the `orderedBy` context key is added in the action context. The purpose of replacing the action context is to remove the default filters. We can simply set an empty dict to avoid any unwanted keys. opw-2278618 closes odoo/odoo#53339 X-original-commit: 4a0348fed0c7c5b9557d1c9ae2dbf2bbfafcc3a2 Signed-off-by: Nicolas Martinelli (nim) --- addons/sale_timesheet/models/sale_order.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py index 9ae4af48edd..bcc5859899f 100644 --- a/addons/sale_timesheet/models/sale_order.py +++ b/addons/sale_timesheet/models/sale_order.py @@ -53,9 +53,7 @@ class SaleOrder(models.Model): def action_view_timesheet(self): self.ensure_one() action = self.env.ref('sale_timesheet.timesheet_action_from_sales_order').read()[0] - ctx = dict(self.env.context or {}) - ctx.pop('group_by', None) - action['context'] = ctx # erase default filters + action['context'] = {} # erase default filters if self.timesheet_count > 0: action['domain'] = [('so_line', 'in', self.order_line.ids)] else: