Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
8624 Prikazi

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
Opusti
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
Opusti
Avtor

thanks

Related Posts Odgovori Prikazi Aktivnost
1
mar. 21
6276
1
feb. 21
3659
3
jan. 20
8303
0
apr. 19
2468
1
mar. 19
4782