Odoo Help


create function openerp 6.0

Helmi Dhaoui
on 6/25/15, 10:17 AM 1,027 views

I created a module in openerp 6.0, the problem that openerp 6.0 did not support the same code as openerp 7, this is the function create: if some one can help me to solve the problem:

def create(self, cr, uid, vals, context=None):

if context is None:

context = {}

if vals['teacher_id']:



if vals['etudiant_ids'][0][2]:

for etudiant in self.pool.get("res.partner").browse(cr,uid,vals['etudiant_ids'][0][2],context):


return super(attendee, self).create(cr, uid, vals, context=context)

the problem is in "if vals['etudiant_ids'][0][2]:"

if vals['etudiant_ids'][0][2]:

TypeError: 'bool' object has no attribute '__getitem__'

You cannot use teacher.attendee=True in OpenERP v6. Other than that, you must check vals.get('etudiant_ids') and proceed!

Serpent Consulting Services Pvt. Ltd.
on 6/26/15, 11:07 AM
On 6/26/15, 6:40 AM

Hi, i think you check the vals has the key 'etudiant_ids' and the the vals has vaule not yet

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/25/15, 10:17 AM
Seen: 1027 times
Last updated: 6/26/15, 11:07 AM