コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3642 ビュー

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
16037
1
9月 22
2080
1
4月 20
142
1
6月 19
4093
1
11月 18
2647