how to create a Wizard with download a file and auto close
- assuming you already have the method to create the file, after the logic of the file creation, you can write return statement as below
return {
'type': 'ir.actions.act_url',
'url': f"/web/content/?model=model_of_the_wizard_&id={self.id}&field=csv_file&download=true&filename=then_name_of_file.csv",
'target': 'self',
'next': {'type': 'ir.actions.act_window_close'},
}
this line
'next': {'type': 'ir.actions.act_window_close'},
will auto close the wizard after the download