コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8594 ビュー

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

アバター
破棄
最善の回答

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

アバター
破棄
著作者

thanks

関連投稿 返信 ビュー 活動
1
3月 21
6260
1
2月 21
3652
3
1月 20
8291
0
4月 19
2448
1
3月 19
4766