DEV Community

Jeevachaithanyan Sivanandan
Jeevachaithanyan Sivanandan

Posted on

5 1 1 1

Odoo : how to create a Wizard with download a file and auto close

how to create a Wizard with download a file and auto close

  1. 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'},
        }
Enter fullscreen mode Exit fullscreen mode

this line

'next': {'type': 'ir.actions.act_window_close'},
Enter fullscreen mode Exit fullscreen mode

will auto close the wizard after the download

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more