Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
8800 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

thanks

Powiązane posty Odpowiedzi Widoki Czynność
1
mar 21
6433
1
lut 21
3770
3
sty 20
8482
0
kwi 19
2514
1
mar 19
4923