Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sehrishnaz/49907c3138b386160ba991254d19c268 to your computer and use it in GitHub Desktop.
Save sehrishnaz/49907c3138b386160ba991254d19c268 to your computer and use it in GitHub Desktop.
Return Action With Sticky Notification in Odoo15
def cmd_send_notification(self):
action = self.env.ref('module_name.id_of_custom_action_window')
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': _('Your Custom Notification Title'),
'message': '%s',
'links': [{
'label': self.customer_id.name,
'url': f'#action={action.id}&id={self.customer_id.id}&model=res.partner',
}],
'sticky': False,
'next': {
'type': 'ir.actions.act_window',
'res_model': 'res.partner',
'res_id': self.customer_id.id,
'views': [(False,'form')]
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment