如果想在显示提示信息以后,执行某一个动作,可以使用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
}
}