Community mailing list archives

Re: many2many gives error "Expected Singleton"

Giovanni Francesco Capalbo
- 06/15/2015 10:21:05
+1  for the  advice, you will be sure to iterate your records
one by one.
just one caveat, when calling an action via button , beware not to use
@one, it is going to iterate on all records in the recordset one by one.
After every iteration it will add the result to a list, this is not good
because as result we want a dictionary of actions not dictionary of list
of actions.
Therefore,in functions triggered by all iterations must be done by hand
using @multi..
You also use self.ensure_one() raises an error if the function has
been called for more than one record.

If that's the case self.ensure_one is actually managing your errors.

On 15-06-15 16:15, Jay Vora wrote:
> I try to extend the hr.employee with children name and birthday

Giovanni Francesco Capalbo - Ontwerp en implementatie

Therp - Maatwerk in open ontwikkeling

tel:  020 3093093