콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3745 화면

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
16207
1
9월 22
2155
1
4월 20
142
1
6월 19
4181
1
11월 18
2741