mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] sql_export : Direct download when executing the query instead of showing wizard
This commit is contained in:
@@ -63,11 +63,12 @@ class SqlFileWizard(models.TransientModel):
|
||||
% {"name": sql_export.name, "date": date, "extension": extension},
|
||||
}
|
||||
)
|
||||
return {
|
||||
"view_mode": "form",
|
||||
"res_model": "sql.file.wizard",
|
||||
"res_id": self.id,
|
||||
"type": "ir.actions.act_window",
|
||||
"target": "new",
|
||||
"context": self.env.context,
|
||||
action = {
|
||||
"name": "SQL Export",
|
||||
"type": "ir.actions.act_url",
|
||||
"url": "web/content/?model=%s&id=%d&filename_field=filename&"
|
||||
"field=binary_file&download=true&filename=%s"
|
||||
% (self._name, self.id, self.file_name),
|
||||
"target": "self",
|
||||
}
|
||||
return action
|
||||
|
||||
@@ -12,13 +12,6 @@
|
||||
hideKanbanOption="1"
|
||||
required="1"
|
||||
/>
|
||||
<separator
|
||||
string="Export file"
|
||||
colspan="4"
|
||||
attrs="{'invisible': [('binary_file', '=', False)]}"
|
||||
/>
|
||||
<field name="binary_file" filename="file_name" />
|
||||
<field name="file_name" invisible="1" />
|
||||
<field name="sql_export_id" invisible="1" />
|
||||
<footer>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user