跳至內容
選單
此問題已被標幟
1 回覆
3871 瀏覽次數

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
16334
1
9月 22
2220
1
4月 20
142
1
6月 19
4270
1
11月 18
2876