Please help up to distinguish (ERPnext v15) TASK assigned to and related TODO allocated to (user) programmatically
Conceptually we understand they are different:
In ERPNext, both “Allocated To” (in ToDo) and “Assigned To” (in Task) are related to user assignments, but they serve different purposes and exist in different contexts. Let’s break down their meanings and use cases:
1. Assigned To (in Task)
- Context: Found in the Task document.
- Purpose: This field specifies the primary assignee for the task itself.
- The person listed in this field is generally the owner of the task, and they are responsible for managing and completing the task.
Key Points:
- Primary Ownership: The person assigned here is considered the main individual responsible for completing the task.
- Action: When a Task is assigned to someone, it signifies they are in charge of the task’s overall progress.
2. Allocated To (in ToDo)
- Context: Found in the ToDo document, which represents reminders or smaller action items related to the Task.
- Purpose: This field specifies the person who is responsible for specific actions or smaller tasks within a larger Task.
Key Points:
- Action Subdivision: The ToDo is often used to break down a larger Task into manageable pieces, and the Allocated To field is used to assign these smaller actions to different people.
- Reminders/Follow-ups: A ToDo can be used to remind someone about something related to the Task, and the Allocated To field assigns this smaller action or follow-up to a user.
Here comes difficult part - how to distingish those programmatically
Example - create
/app/task/TASK-2025-00004 , then assign user
ERPnext creates automatically the related TODO
{
"name": "jharq2smt9",
"description": "<div class=\"ql-editor read-mode\"><p>Task to check allocated to</p></div>",
"allocated_to": "assetm@example.com",
"status": "Open",
"owner": "Administrator"
}
then if we want to have separate TODO and create related to TASK-2025-00004 new TODO and allocate to
then we have 2 TODOs, etc
{
"name": "jharq2smt9",
"description": "<div class=\"ql-editor read-mode\"><p>Task to check allocated to</p></div>",
"allocated_to": "assetm@example.com",
"status": "Open",
"owner": "Administrator"
},
{
"name": "n761unq7d4",
"description": "<div class=\"ql-editor read-mode\"><p>New TODO for the task </p></div>",
"allocated_to": "johnsmith@example.com",
"status": "Open",
"owner": "Administrator"
}
The question - how programmatically distingush those 2 types as assigned to - is a user who is responsible for entire task, all others - they are smaller TODOs
So far - only one way - to check if text name of TASK = name of TODO which is not efficient and 100% accurate