I want to add the project_id to tasks of a project:
all_projects = request.env['project.project'].search([])
for project in all_projects:
for task in project.tasks:
task.project_id = project.id
Thank you for any suggestions
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to add the project_id to tasks of a project:
all_projects = request.env['project.project'].search([])
for project in all_projects:
for task in project.tasks:
task.project_id = project.id
Thank you for any suggestions
Hi,
If you have a lot of tasks in the database, how will you distinguish the tasks that you have to update ? is it something like, changing existing project to an another project ?
so first you have to decide it and add it in the below domain ?
domain = []
tasks = self.env['project.task'].search(domain)
for task in tasks:
task.project_id = ID_OF_THE_NEW_PROJECT
Thanks
Hi,
the projects already contain the tasks in project.task_ids.
Now I need to show the project in the task.project_id
Thank you
Hi Niyas,
I solved it. Had to set display_name for the project.
Thank you
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Nov 24
|
1483 | ||
|
1
Nov 24
|
1188 | ||
|
2
Sep 24
|
1047 | ||
Update stock quantity
Solved
|
|
1
Aug 24
|
2451 | |
|
3
Aug 24
|
2686 |