İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2977 Görünümler

I'm trying to create a sequence of 

admission_code field

but the error occurs  this is the error:
result=super(School,self).create(vals_list)
NameError: name 'School' is not defined


I don't understand what should i insert inside super

this is the code of the function:

@api.model
def create(self,vals_list):
if vals_list.get('admission_code','New')=='New':
vals_list['admission_code']=self.env['ir.sequence'].next_by_code('school.student.sequence') or 'New'
result=super(School,self).create(vals_list)
return result

and this is the code of sequence.xml file:


noupdate="0">
model="ir.sequence" id="school_sequence">
name="name">School Sequence
name="code">school.student.sequence
name="padding">5
name="company_id" eval="False"/>




Avatar
Vazgeç
En İyi Yanıt

Hi,

first parameter inside super function is Class name

Avatar
Vazgeç
Üretici

Thanks Sahar

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 24
2609
1
Eki 23
2673
0
Tem 23
1802
Libary managment Çözüldü
2
May 23
1821
1
Mar 23
3045