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
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
3
thg 9 25
|
3641 | |||
|
0
thg 8 25
|
1081 | |||
|
1
thg 8 25
|
3429 | |||
|
2
thg 7 25
|
9001 | |||
|
2
thg 7 25
|
5349 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.