Skip to content
Snippets Groups Projects
Commit 4a0348fe authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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#53302

X-original-commit: 4fc6ec94
Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 168762a7
No related branches found
No related tags found
No related merge requests found
......@@ -139,9 +139,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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment