This module allows you to add a confirmation step to you business logic. You can customize the message you want to display. You can achieve that by following these 3 steps:
- Add the odoo_confirm_wizard to your module's dependencies
- Return a window action from anywhere in your code.
return {
'type': 'ir.actions.act_window',
'name': 'The name of the action',
'res_model': 'odoo.confirm.wizard',
'view_type': 'form',
'view_mode': 'form',
'target': 'new',
'context': {
'model': self._name, # Required
'method': 'method_to_call', # Required Method called when the user hits the yes button
'record_id': self.id, # Required
'message':'Replace with your custom message' # Optional The default is an empty string
'args':{'arg1':value1,'arg2':value2,} # Optional dictionary holding the methods arguments
}
}- Define the method to call in the model you have indicated
When the method you want to call returns an action (eg. window action) it is not triggered.
Fell free to enrich this module with your brilliant ideas.