@onchange('some_field')
def onchange_some_field(self):
return {
'warning': {'title': "Warning", 'message': "What is this?", 'type': 'notification'},
}
please notice that if you skip the:
'type': 'notification'
it would return a pop-up like UserError message that would require you to press ok
def action_button(self):
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'success', # you can change this to get defferent colors with 'error' or 'warning'
'title': _("Notification Title"),
'message': 'Notification message',
'next': {
'type': 'ir.actions.act_window_close'
},
}
}