Error inserting Many2many field

Bug #1284768 reported by Manu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OERPLib
Fix Released
Undecided
Unassigned

Bug Description

I'm using OERPLib 0.8.0

The many2many syntax using += stated in the documentation:

user = oerp.get('res.users').browse(1)
groups = oerp.get('res.groups').browse([4, 5])
user.groups_id += list(groups)

does not work if the many2many field doesn't have any item. It gives this error:

TypeError: unsupported operand type(s) for +=: 'tupleiterator' and 'list'

However, if it has at least one item, it works without problem.

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

Thanks for the bug report Manu, the bugfix is almost ready (it was affecting one2many fields too).

Changed in oerplib:
milestone: none → 0.8.1
status: New → In Progress
no longer affects: oerplib/0.8
Changed in oerplib:
status: In Progress → Fix Committed
Revision history for this message
Manu (manu-tiedra) wrote :

Thank you for the ultraquick fix Sébastien!

Your work in OERPLib is awesome.

Changed in oerplib:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.