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

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.

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

Try,

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


Kind regards.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
6
thg 2 24
12034
5
thg 7 20
10723
1
thg 11 16
14672
2
thg 10 15
10768
1
thg 8 24
6795