Skip to content

[18.0][FIX] helpdesk_mgmt_project: explicitly assign project to task#998

Draft
github-yotech wants to merge 5 commits into
OCA:18.0from
github-yotech:fix/18.0-fix-helpdesk_mgmt_project-task-project-assignment
Draft

[18.0][FIX] helpdesk_mgmt_project: explicitly assign project to task#998
github-yotech wants to merge 5 commits into
OCA:18.0from
github-yotech:fix/18.0-fix-helpdesk_mgmt_project-task-project-assignment

Conversation

@github-yotech
Copy link
Copy Markdown

Problem Description
When creating a new task from the task_id field on a helpdesk.ticket form, the task is created as a "Private Task" (assigned to the user's private project) instead of adopting the project already selected on the ticket.

Expected Behavior
Any new task created and linked to a ticket should explicitly inherit the project_id from the Helpdesk Ticket.

Root Cause
The previous implementation relied solely on the UI passing default_project_id via context. However, duplicate project_id field definitions in the XML (one hidden, one visible) caused the Odoo 18 Web Client to fail during context evaluation, resulting in the task being created without a project. Furthermore, the backend did not explicitly enforce the project synchronization upon task linkage.

Solution
Following OCA guidelines prioritizing Explicit over Implicit behavior:

  1. Backend Fix: Overrode create and write on helpdesk.ticket. If a task is linked that does not have a project_id, it is now explicitly assigned the ticket's project_id.
  2. UI Cleanup: Removed the redundant invisible="1" duplicate field definitions in helpdesk_ticket_view_form to prevent Web Client evaluation issues.
  3. Tests: Updated the unit test to deliberately create a task without context and verify that the backend correctly and explicitly assigns the project upon linking it to the ticket.

@OCA-git-bot OCA-git-bot added series:18.0 mod:helpdesk_mgmt_project Module helpdesk_mgmt_project labels May 6, 2026
@github-yotech github-yotech changed the title [FIX] helpdesk_mgmt_project: explicitly assign project to task [18.0][FIX] helpdesk_mgmt_project: explicitly assign project to task May 6, 2026
@github-yotech github-yotech marked this pull request as draft May 6, 2026 14:52
@OCA-git-bot OCA-git-bot added the mod:helpdesk_mgmt_timesheet Module helpdesk_mgmt_timesheet label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:helpdesk_mgmt_project Module helpdesk_mgmt_project mod:helpdesk_mgmt_timesheet Module helpdesk_mgmt_timesheet series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants