Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
8528 Vistas

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
Mejor respuesta

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

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 21
6170
1
feb 21
3584
3
ene 20
8180
0
abr 19
2385
1
mar 19
4654