Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.rst

Odoo Community Association

Helpdesk Mgmt Project Domain

Beta License: AGPL-3 OCA/helpdesk Translate me on Weblate Try me on Runboat

This module allows you to configure domains to filter projects and tasks available for selection in helpdesk tickets. It provides both static domain configuration and dynamic Python-based filtering for enhanced flexibility.

Table of contents

This module allows you to configure domains to filter projects and tasks available for selection in helpdesk tickets, reducing errors and improving efficiency.

  • Automated Filtering: Configure domains to show only relevant projects and tasks for each team
  • Error Reduction: Minimize manual selection errors by limiting available options
  • Smart Task Filtering: Tasks are automatically filtered by the selected project
  • Flexible Configuration: Use static domains or dynamic Python code for complex rules
  • Show only active projects
  • Filter by client/partner
  • Separate internal from external projects
  • Filter by project tags or categories
  • Show only tasks from selected project
  • Filter by assignment status (assigned/unassigned)
  • Filter by priority or urgency
  • Filter by task tags or phases
  • Use Python code for dynamic filtering based on ticket data
  • Combine multiple conditions with AND/OR operators
  • Apply different rules for different teams

To configure this module, you need to:

  1. Configure global project and task domains at company level.
  2. Configure team-specific project and task domains.
  3. Set up Python-based dynamic domains (optional).
  1. Go to Settings > Helpdesk to configure the global project and task domains.
  2. In the "Project & Task Domain Configuration" section, set the Project Domain field using the visual domain builder.
  3. Set the Task Domain field using the visual domain builder.
  4. These domains will be applied to all teams that don't have their own domains configured.
  5. You can also Activate or Deactivate the global domains.
  1. Go to Helpdesk > Configuration > Teams to configure team-specific domains.
  2. Edit or create a team.
  3. In the Project Domain tab:
    • Set the Project Domain field using the visual domain builder.
    • Configure the Project Domain Python Code field for dynamic domains (optional).
  4. In the Task Domain tab:
    • Set the Task Domain field using the visual domain builder.
    • Configure the Task Domain Python Code field for dynamic domains (optional).
  5. Team domains will be combined with the company domain using AND logic.

Both "Project Domain" and "Task Domain" fields use a visual builder that allows:

  1. Click on the field to open the domain builder.
  2. Select the field from the Project/Task model (e.g., Active, Partner, Type, User).
  3. Choose the operator (e.g., =, !=, >, <, in, not in).
  4. Define the value (e.g., True, False, partner name, user name).
  5. Add more conditions with AND/OR logic.
  6. Save the domain configuration.
  • Field: Active
  • Operator: =
  • Value: True
  • Domain: [('active', '=', True)]
  • Field: Partner
  • Operator: !=
  • Value: False
  • Domain: [('partner_id', '!=', False)]
  • Field: Partner
  • Operator: =
  • Value: [Client Name]
  • Domain: [('partner_id', '=', 123)] (where 123 is the client ID)
  • Field: Tags
  • Operator: in
  • Value: [Internal]
  • Domain: [('tag_ids', 'in', [4])] (where 4 is the tag ID)
  • Field: Tags
  • Operator: in
  • Value: [External]
  • Domain: [('tag_ids', 'in', [5])] (where 5 is the tag ID)
  • Field: Tags
  • Operator: in
  • Value: [Internal, External]
  • Domain: ['|', ('tag_ids', 'in', [4]), ('tag_ids', 'in', [5])]
  • Field: Active
  • Operator: =
  • Value: True
  • Domain: [('active', '=', True)]
  • Field: Tags
  • Operator: in
  • Value: [Development]
  • Domain: [('tag_ids', 'in', [1])] (where 1 is the tag ID)
  • Field: Tags
  • Operator: in
  • Value: [Testing]
  • Domain: [('tag_ids', 'in', [2])] (where 2 is the tag ID)
  • Field: Tags
  • Operator: in
  • Value: [Development, Testing]
  • Domain: ['|', ('tag_ids', 'in', [1]), ('tag_ids', 'in', [2])]
  • Field: User
  • Operator: =
  • Value: False
  • Domain: [('user_ids', '=', False)]
  • Field: User
  • Operator: in
  • Value: [User Name]
  • Domain: [('user_ids', 'in', [123])] (where 123 is the user ID)
  • Field: Priority
  • Operator: =
  • Value: 1
  • Domain: [('priority', '=', '1')]

For advanced users, you can use Python code to create dynamic domains:

  1. Go to the team configuration.
  2. Edit the Project Domain Python Code or Task Domain Python Code field.
  3. Write Python code that returns a domain list.
  4. Available variables: ticket, env, user, company, AND, OR, normalize.
# Filter projects based on ticket partner (from demo data)
if ticket.partner_id:
    domain = [('commercial_partner_id', '=', ticket.commercial_partner_id.id)]
else:
    domain = [('id', '=', 0)]  # No projects if no partner
# Filter tasks not assigned to anyone (from demo data)
domain = [('user_ids', '=', False)]
# Filter tasks based on ticket project
if ticket.project_id:
    domain = [('project_id', '=', ticket.project_id.id)]
else:
    domain = [('id', '=', 0)]  # No tasks if no project selected
# Filter tasks by development or testing tags (from demo data)
domain = ['|', ('tag_ids', 'in', [1]), ('tag_ids', 'in', [2])]
# Filter high priority tasks assigned to specific users
if ticket.partner_id:
    domain = AND([
        [('priority', '=', '1')],  # High priority
        [('user_ids', '!=', False)]  # Assigned tasks
    ])
else:
    domain = [('priority', '=', '1')]  # High priority only

All domains are combined using AND logic:

  1. Company global project domain (base filter for all teams).
  2. Team static project domain (always combined with company domain).
  3. Team Python project code (always combined with company + team domains).
  1. Company global task domain (base filter for all teams).
  2. Team static task domain (always combined with company domain).
  3. Team Python task code (always combined with company + team domains).

The final project domain will be: Company Project Domain AND Team Project Domain AND Python Project Domain.

The final task domain will be: Company Task Domain AND Team Task Domain AND Python Task Domain.

There are no specific permissions required for this module. The domain filtering respects the user's existing project access permissions set in the system.

If domains are not working as expected:

  1. Check that the domain syntax is correct.
  2. Verify that the Python code (if used) has no syntax errors.
  3. Ensure that the fields referenced in domains exist in the Project model.
  4. Check the Odoo logs for any domain evaluation errors.
  1. Ticket Creation: When a ticket is created, the system checks:
    • If the team has a configured project domain
    • If not, uses the company's global project domain
    • If no domain is configured, all projects remain available
  2. Ticket Editing: The project domain is automatically applied to the "Project" field of the ticket
  3. Validation: If the project domain is invalid, the system ignores it and shows all projects
  1. Project Selection: When a project is selected in a ticket:
    • The system applies the configured task domain
    • Tasks are automatically filtered by the selected project
    • Only tasks belonging to the selected project are shown
  2. Dynamic Filtering: Task filtering is updated when:
    • The project field changes
    • The team changes
    • Other relevant ticket fields change
  3. Smart Filtering: The system ensures tasks are always relevant to the selected project, preventing selection of tasks from other projects
  • Static Domains: Applied immediately when fields change
  • Python Domains: Evaluated dynamically based on current ticket data
  • Combination Logic: All applicable domains are combined using AND logic
  • Fallback Behavior: If any domain fails, the system gracefully falls back to showing all available options

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

  • Escodoo

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

marcelsavegnago

This module is part of the OCA/helpdesk project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.