Skip to Content
Menú
This question has been flagged
1 Respondre
8867 Vistes

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
Descartar
Best Answer

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
Descartar
Autor

thanks

Related Posts Respostes Vistes Activitat
1
de març 21
6496
1
de febr. 21
3833
3
de gen. 20
8565
0
d’abr. 19
2590
1
de març 19
4992