[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-06-19 14:10:00 +00:00
parent 584b76d70b
commit d5ba35cb7c
+1 -3
View File
@@ -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: