Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8611 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 21
6272
1
ก.พ. 21
3655
3
ม.ค. 20
8297
0
เม.ย. 19
2460
1
มี.ค. 19
4775