[FIX] sale_timesheet: remove group_by

- Group the SO list view by Analytic Account
- Go to a SO
- Click on the stat button 'Timesheets'

Traceback because the field `analytic_account_id` is not on Timesheets.

opw-2124539

closes odoo/odoo#40840

X-original-commit: 3f17dd36e8369c21e55009e5492438cb9f9ea53d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-11-26 07:11:27 +00:00
parent 3460b3ca15
commit b15b6e30e1
+3 -1
View File
@@ -138,7 +138,9 @@ 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]
action['context'] = self.env.context # erase default filters
ctx = dict(self.env.context or {})
ctx.pop('group_by', None)
action['context'] = ctx # erase default filters
if self.timesheet_count > 0:
action['domain'] = [('so_line', 'in', self.order_line.ids)]
else: