Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
8619 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

thanks

Post correlati Risposte Visualizzazioni Attività
1
mar 21
6273
1
feb 21
3657
3
gen 20
8300
0
apr 19
2465
1
mar 19
4781