|
|
""" This compute method allows to see all the names of assigned users to each task contained in `self`.
When we are in the project sharing feature, the `user_ids` contains only the users if we are a portal user.
That is, only the users in the same company of the current user.
So this compute method is a related of `user_ids.name` but with more records that the portal user
can normally see.
(In other words, this compute is only used in project sharing views to see all assignees for each task)
"""
if self._origin:
# fetch 'user_ids' in superuser mode (and override value in cache
# browse is useful to avoid miscache because of the newIds contained in self
self.invalidate_recordset(fnames=['user_ids'])
self._origin.fetch(['user_ids'])
for task in self.with_context(prefetch_fields=False):
task.portal_user_names = format_list(self.env, task.user_ids.mapped('name'))
|
|