跳至內容
選單
此問題已被標幟
2 回覆
5293 瀏覽次數

I use a button to update values on a table in odoo and I want to notify the user about the update. The update works fine when the notification is off. however, when I set the notification, although the update is performed, the screen does not refresh but the notification is displayed. Below is the code I use for the notification. Can someone help see how I can have the notification displayed and the screen to refresh?

return {
            'name': _('Information'),
            'type': 'ir.actions.client',
            'tag': 'display_notification',
            'params': {
                'type': 'info',
                'title': _('Information'),
                'message': 'All quantities are up to date',
                'fadeout': 'slow',
            },
        }


頭像
捨棄
最佳答案
chain the display_notification with act_window_close, pls see below

return { 'name': _('Information'), 'type': 'ir.actions.client', 'tag': 'display_notification', 'params': { 'type': 'info', 'title': _('Information'), 'message': 'All quantities are up to date', 'fadeout': 'slow',
'next': {
'type': 'ir.actions.act_window_close',
} }, }


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 23
43134
1
10月 23
4837
1
12月 22
4512
1
11月 22
2436
1
1月 22
2101