Odoo Help

0

how to check if an record has children ?

By
MouBou
on 5/25/16, 12:02 PM 320 views

Hello i have a question about checking records if the have children records

elaborate your query

webkul, Prakash Sharma
on 5/26/16, 3:41 AM
1

Bejaoui Souheil

--Bejaoui Souheil--
899
| 2 1 4
Rennes, France
--Bejaoui Souheil--

Odoo developer,  functional and technical consultant

souheil_bejaoui@hotmail.fr

Bejaoui Souheil
On 8/13/16, 5:59 AM

Hi,

This how you can do:

child_ids = self.search([('parent_id','=',self.id)])
if child_ids:
     return True
else:
     return False

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/25/16, 12:02 PM
Seen: 320 times
Last updated: 8/13/16, 5:59 AM