odoo 通知和刷新当前页面

 

this.actionService.doAction({
                        'type': 'ir.actions.client',
                        'tag': 'reload',
                    });
            this.actionService.doAction({
                        type: 'ir.actions.client',
                        tag: 'display_notification',
                        params:{
                            'title': "提醒",
                            'message': x,
                            'sticky': false,
                            'className':'bg-danger',}}
                            );

  

 

python: 

def button_immediate_install(self):
    if self.module_id and self.module_state != 'installed':
       self.module_id.button_immediate_install()
       return {
          'type': 'ir.actions.client',
          'tag': 'reload',
       }

  

 

js

  

js: 
window.parent.location.reload();

  

posted @ 2023-10-26 15:38  CrossPython  阅读(263)  评论(0编辑  收藏  举报