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

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

thanks

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Mar 21
6264
1
Şub 21
3654
3
Oca 20
8294
0
Nis 19
2452
1
Mar 19
4773