Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4172 Prikazi


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']:

teacher=self.pool.get("res.partner").browse(cr,uid,vals['teacher_id'],context)

teacher.attendee=True

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

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

etudiant.attendee=True

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__'

Avatar
Opusti

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

Best Answer

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


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
okt. 15
5270
1
avg. 15
3096
2
mar. 15
5391
1
mar. 15
4228
1
mar. 15
8758