콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4469 화면


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

아바타
취소

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

베스트 답변

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


아바타
취소
관련 게시물 답글 화면 활동
1
10월 15
5589
1
8월 15
3341
2
3월 15
5701
1
3월 15
4513
1
3월 15
9099