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

I want to refresh the view page when delete is performed.

I tried unlink() method I see some codes to reload the page.

return { 'type': 'ir.actions.client', 'tag': 'reload', } 

But when I use unlink() method

@api.multi

def unlink(self):


    return models.Model.unlink(self)

It has to return the unlink() to delete the record so I can not call the return for reload.

I tried this

@api.multi

def unlink(self):

    x={

        'type': 'ir.actions.client',

        'type': 'reload',}

    return models.Model.unlink(self),x

But its not working.

Any other suggestions to reload/refresh the view page of odoo when delete is performed.


Thanks.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try,

@api.multi
def unlink(self):
res = super(YOURCLASS, self).unlink()
return { 'type': 'ir.actions.client', 'tag': 'reload', }


Kind regards.


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
6
ก.พ. 24
12100
Confirm on delete one2many line แก้ไขแล้ว
5
ก.ค. 20
10818
1
พ.ย. 16
14773
2
ต.ค. 15
10871
1
ส.ค. 24
7076