Created
June 27, 2022 08:49
-
-
Save sehrishnaz/49907c3138b386160ba991254d19c268 to your computer and use it in GitHub Desktop.
Return Action With Sticky Notification in Odoo15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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