Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Project HR

Entity: project.task

Compute Method: _compute_allowed_assigned_user_ids

Inputs Method Outputs
user_obj = self.env["res.users"]
for task in self:
            domain = [("share", "=", False), ("active", "=", True)]
            if task.hr_category_ids:
                domain = [
                    (
                        "employee_ids.company_id",
                        "=",
                        (task.company_id.id or self.env.company.id),
                    ),
                    ("employee_ids.category_ids", "in", task.hr_category_ids.ids),
                ]
            task.allowed_assigned_user_ids = user_obj.search(domain)

Back to entity