我在 openerp 6.0 中创建了一个模块,openerp 6.0 不支持与 openerp 7 相同的代码的问题,这是函数 create: 如果有人可以帮助我解决问题:
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)
问题出在“如果 vals['etudiant_ids'][0][2]:”
if vals['etudiant_ids'][0][2]:
TypeError: 'bool' object has no attribute '__getitem__'