Comment 2 for bug 1179313

Revision history for this message
Sébastien Alix (sebastien-alix) wrote :

That's done.

With a list of records::

    >>> records = oerp.get('my.model').browse([4, 5])
    >>> my_record.many_ids += list(records)
    >>> [r.id for r in my_record.many_ids]
    [1, 2, 3, 4, 5]

With a list of record IDs::

    >>> my_record.many_ids += [4, 5]
    >>> [r.id for r in my_record.many_ids]
    [1, 2, 3, 4, 5]

With an ID only::

    >>> my_record.many_ids -= 4
    >>> [r.id for r in my_record.many_ids]
    [1, 2, 3, 5]

With a record only::

    >>> record = oerp.get('my.model').browse(5)
    >>> my_record.many_ids -= record
    >>> [r.id for r in my_record.many_ids]
    [1, 2, 3]