Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2989 Lượt xem

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




Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

first parameter inside super function is Class name

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Sahar

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
2613
1
thg 10 23
2682
0
thg 7 23
1807
Libary managment Đã xử lý
2
thg 5 23
1821
1
thg 3 23
3062