Re: many2many gives error "Expected Singleton"

Problem solved. I forgotten to go deeper in rec.
@api.depends('cp_childs_ids')
def _childs_count_g16(self):
count = 0
if self.cp_childs_ids:
for rec in self:
for child in rec.cp_childs_ids:
age = self._birthday(child.birthday)
if age >= 16:
count += 1

Am 13.06.2015 um 23:20 schrieb Mathias
Neef:

<blockquote cite="mid:557C9EAF.2000506@copado.de" type="cite">
Hi!

I have an error on a many2many field which is produced by
ensure_one().

I try to extend the hr.employee with children name and birthday
and some computed fields like number of childs, childs under 16
and childs 16+.
Hope someone can help me. Here is the complete code:
from datetime import datetime, date