Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8603 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 21
6264
1
thg 2 21
3654
3
thg 1 20
8294
0
thg 4 19
2452
1
thg 3 19
4772