summaryrefslogtreecommitdiff
path: root/addons/sale_timesheet
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2021-03-11 22:04:13 +0000
committerGoffin Simon <sig@odoo.com>2021-03-15 08:35:20 +0000
commit3cf66c4ed482bb14973b57cacbe4ca56b93650d2 (patch)
treea5fe66f007f9a27fd3aedbc112dbe1da6afe028a /addons/sale_timesheet
parentaf8ce1d8891a4dcdeb80b069a114299d84e021f1 (diff)
[FIX] sale_timesheet: all the employees in the project overview
Steps to reproduce the bug: 1/ Install these apps: Sales, Planning, Employees, Project, Timesheets 2/ Add some employees (stay below 20 employees) 3/ Create a project with Planning, Timesheets and Billable 4/ Click on the overview Bug: List of all employees opw:2460616 closes odoo/odoo#67726 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons/sale_timesheet')
-rw-r--r--addons/sale_timesheet/models/project_overview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/sale_timesheet/models/project_overview.py b/addons/sale_timesheet/models/project_overview.py
index 27979afc262..1af36aac31f 100644
--- a/addons/sale_timesheet/models/project_overview.py
+++ b/addons/sale_timesheet/models/project_overview.py
@@ -3,6 +3,7 @@ import babel.dates
from dateutil.relativedelta import relativedelta
import itertools
import json
+from odoo.osv import expression
from odoo import fields, _, models
from odoo.osv import expression
@@ -20,7 +21,9 @@ class Project(models.Model):
def _qweb_prepare_qcontext(self, view_id, domain):
values = super()._qweb_prepare_qcontext(view_id, domain)
-
+ project_ids = self.env.context.get('active_ids')
+ if project_ids:
+ domain = expression.AND([[('id', 'in', project_ids)], domain])
projects = self.search(domain)
values.update(projects._plan_prepare_values())
values['actions'] = projects._plan_prepare_actions(values)