Skip to content

Commit

Permalink
[FIX] sale_timesheet: clean context
Browse files Browse the repository at this point in the history
- 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#53302

X-original-commit: 4fc6ec9
Signed-off-by: Nicolas Martinelli (nim) <[email protected]>
  • Loading branch information
nim-odoo committed Jun 19, 2020
1 parent 168762a commit 4a0348f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions addons/sale_timesheet/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ def action_view_project_ids(self):
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:
Expand Down

0 comments on commit 4a0348f

Please sign in to comment.