Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
8569 Tampilan

HI, 

i have 2 states in my form view statusbar, Draft and Sent. default state is draft. when i click save button ( in form view), the status should change into Sent. How i do this ? please help

Avatar
Buang
Jawaban Terbai

Hi,

You can override the create method or write method and change the state to the required state.

please refer this

    
    @api.model
def create(self,vals):
vals['state'] = 'sent'
    return super(ClassName, self).create(vals)

   
    @api.multi
def write(self,vals):
vals['state'] = 'sent'
    return super(ClassName, self).write(vals)



Thanks

Avatar
Buang
Penulis

thanks

Post Terkait Replies Tampilan Aktivitas
1
Mar 21
6239
1
Feb 21
3646
3
Jan 20
8271
0
Apr 19
2431
1
Mar 19
4744