I would like to add a menu item that would create a CSV file and let me download it when i click on that item. I already created my menuitem and a related action:
<record id="my_action" model="ir.actions.server"> <field name="sequence" eval="5"/> <field name="state">code</field> <field name="type">ir.actions.server</field> <field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/> <field name="name">Export CSV</field> <field name="code">self.my_action(cr, uid, context.get('active_ids', ))</field>
<menuitem name="action" parent="hr_attendance.menu_hr_time_tracking" sequence="99" id="my_id action="my_action"/>
When i click on that button, i would like to generate a CSV file and allow the user to download it.
Could anyone help me? I searched with google, but what i find is always related to odoo's standard export feature.
Thanks a lot!
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/26/16, 10:00 AM|
|Seen: 579 times|
|Last updated: 1/26/16, 11:26 AM|