Invalid many2many encoding in test_orm.py

Bug #1244428 reported by Stefan Rijnhart (Opener)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Low
OpenERP's Framework R&D

Bug Description

I'm suggesting the following change to fix an exception occuring in the test suite:

- self.uid2 = self.users.create(cr, uid, {'name': 'test user', 'login': 'test', 'groups_id': [4,employee_gid]})
+ self.uid2 = self.users.create(cr, uid, {'name': 'test user', 'login': 'test', 'groups_id': [(4,employee_gid)]})

======================================================================
ERROR: testAccessDeletedRecords (openerp.tests.test_orm.TestORM)
Verify that accessing deleted records works as expected
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/oerstfdev70/openobject-server/openerp/tests/test_orm.py", line 24, in setUp
    self.uid2 = self.users.create(cr, uid, {'name': 'test user', 'login': 'test', 'groups_id': [4,employee_gid]})
  File "/home/oerstfdev70/openobject-addons/auth_signup/res_users.py", line 276, in create
    user_id = super(res_users, self).create(cr, uid, values, context=context)
  File "/home/oerstfdev70/openobject-addons/note/note.py", line 191, in create
    user_id = super(res_users, self).create(cr, uid, data, context=context)
  File "/home/oerstfdev70/openobject-addons/hr/hr.py", line 306, in create
    user_id = super(res_users, self).create(cr, uid, data, context=context)
  File "/home/oerstfdev70/openobject-addons/mail/res_users.py", line 77, in create
    user_id = super(res_users, self).create(cr, uid, data, context=context)
  File "/home/oerstfdev70/openobject-server/openerp/addons/base/res/res_users.py", line 764, in create
    return super(users_view, self).create(cr, uid, values, context)
  File "/home/oerstfdev70/openobject-server/openerp/addons/base/res/res_users.py", line 602, in create
    self.write(cr, uid, [user_id], {'groups_id': groups}, context)
  File "/home/oerstfdev70/openobject-addons/mail/res_users.py", line 173, in write
    user_group_ids = [command[1] for command in vals['groups_id'] if command[0] == 4]
TypeError: 'int' object is unsubscriptable

Related branches

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: New → Confirmed
summary: - [7.0] Invalid many2many encoding in test_orm.py
+ Invalid many2many encoding in test_orm.py
Changed in openobject-server:
importance: Medium → Low
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.