odoo显示消息的函数 display_notification next参数的使用

如果想在显示提示信息以后,执行某一个动作,可以使用next参数,传入一个tag类型的动作,或者act_window的动作。

 

 

next_act = {
                    'type': 'ir.actions.act_window',
                    'name': '供应商发票导入',
                    'res_model': 'galaxy.vendor.invoice',
                    'target': 'current', #traget=new的时候,form action buttons才生效,即form上的按钮显示save,cancel状态
                    'res_id':self.id,
                    'context': self.env.context,
                    "views": [[False, "form"]],
                    #'flags': {'form': {'action_buttons': True, 'options': {'mode': 'edit'}}},
                    #'views': [[view_id, 'form']]
        }


def display_notification(title, message,next=None):
    return {'type': 'ir.actions.client',
            'tag': 'display_notification',
            'params': {
                'title': title,
                'message': message,
                'sticky': False,
                'className': 'bg-info',
                'next': next
            }
    }


 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值