跳至内容
菜单
此问题已终结
1 回复
3875 查看

I need to find for example all projects that have tasks.

task_ids = fields.One2Many('project.task', 'project_id')

Like: search([('task_ids', '>', 0)])?

Is there a way to do that or do I have to get tasks and then loop trough them to get project ids?

形象
丢弃
最佳答案
task_ids","!=",False
形象
丢弃

you can do this but many ways to do it

either you can these ways that i know:

for rec in self:

if rec.task_ids:

#statement

or self.search([('task_ids', '!=', False)])

编写者

Thanks it works!

相关帖文 回复 查看 活动
2
12月 22
16340
1
9月 22
2235
1
4月 20
142
1
6月 19
4275
1
11月 18
2881