Skip to content

mail_activity_team configuration may lead to unwanted errors #114

@jgebel

Description

@jgebel

Configuration of activity teams may lead to unwanted errors when activities are created automatically.
Note: If this is indeed the desired behavior, then please see the section "Additional context"

Module

mail_activity_team

Describe the bug

You have a user which is not in your activity team and you do something that would automatically create an activity for that user you get the error: "The assigned user is not member of the team ."
E.g. when leaves/leave allocations are created, see example below.

To Reproduce

Affected versions:
18.0

Steps to reproduce the behavior:

  1. Start runboat and login as admin
  2. Install hr_holiday module (and of course mail_activity_team)
  3. Create 2 new users (one will be refered as "base user", the other one as "manager")
  4. Set access rights for Time-off
    a) For base user leave time-off empty
    b) For manager set "Officer: Manage all requests" role
  5. For both new users use the action to create employees
  6. Go to the employee app and set the following on the employees:
    a) For base user: set manager to the created manager user
  7. Go to time off app -> configuration -> time off types
  8. Choose a type (e.g. "Paid Time Off") and set "Approval" to "By Employee's Approver" (for Time Off Requests and Allocation Requests)
  9. Create two Activity teams, e.g. "Admin" with the admin in it and "HR" with the manager user in it.
  10. Try to create (as admin) an allocation request for the base user.
    The activity, by configuration, should be created for the manager user but the error is thrown mentioning the configuration of the activity team.
    (I tried to keep the example simple, see further explanations below)

Expected behavior
You should be able to use Odoo default workflows even when the activity team members may differ for the activity creating and receiving users.
(E.g. you have multiple activity teams for HR where every team manages a different department with its employees and the teams may have overlapping responsibilities.)

Additional context
If this is really the desired behavior then it would be nice to have an option on the activity teams to not only set the default team but also to set if a team can be assigned for activities of that type.
So when e.g. a leave allocation would be created the activity type "Allocation Approval" has a option like "No team activity" set then the activity would be assigned to the user (like the Odoo default workflow) instead of a team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions