تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2991 أدوات العرض

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"/>




الصورة الرمزية
إهمال
أفضل إجابة

Hi,

first parameter inside super function is Class name

الصورة الرمزية
إهمال
الكاتب

Thanks Sahar

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أكتوبر 24
2614
1
أكتوبر 23
2682
0
يوليو 23
1808
Libary managment تم الحل
2
مايو 23
1822
1
مارس 23
3065