Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
c33761b
Add sql export module (migration from v7)
florian-dacosta Feb 5, 2016
71875f3
[IMP] add support of variables in queries
bguillot May 23, 2016
28b005c
[MIG] Migrate module from 8.0 to 9.0
mourad-ehm Aug 30, 2016
bc2a214
[REF] create a new module sql_request_abstract
legalsylvain Feb 22, 2017
fd19844
Fix version
florian-dacosta Mar 6, 2017
825085b
[IMP]encode output file
AaronHForgeFlow Mar 14, 2017
279d323
[FIX] various improvement. Courtesy @dreispt review
legalsylvain Apr 18, 2017
2d30e13
OCA Transbot updated translations from Transifex
oca-transbot Jun 10, 2017
5cac19d
[MIG][10.0]sql_export v10
AaronHForgeFlow Nov 10, 2017
7c827a8
[FIX] mogrify doesn't allow dicts
MiquelRForgeFlow Jun 25, 2018
271ea7d
[UPD] Update sql_export.pot
oca-travis Jun 27, 2018
d129894
Translated using Weblate (German)
rschnapka Sep 6, 2018
bc0e988
IMP Readme for Sql Export Module
bealdav Oct 16, 2018
b2c440a
Update translation files
oca-transbot Nov 25, 2018
7e05397
PORT v12 sql_export
bealdav Apr 8, 2019
4773d3e
FIX sql_export: test and misc
bealdav Apr 9, 2019
f3a52c4
[UPD] Update sql_export.pot
oca-travis Apr 19, 2019
2e35db8
[FIX] title level in readme fragments
sbidoul May 11, 2019
f96e04e
[UPD] README.rst
OCA-git-bot May 11, 2019
22beb91
Update translation files
oca-transbot May 20, 2019
cf4ab8a
IMP sql_export: render field as require when matching field def
bealdav May 22, 2019
25fe8ef
Fix uses of params in sql query
florian-dacosta Jun 20, 2019
35c9fc2
[UPD] README.rst
OCA-git-bot Jul 29, 2019
d7baff4
Adapt module sql_export_mail to be compatible with multiple file format
florian-dacosta Aug 21, 2019
46cfb46
Translated using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
ccfb931
Migrate sql_export_excel to v12
florian-dacosta Sep 2, 2019
ad9d26e
Translated using Weblate (Portuguese (Brazil))
Sep 2, 2019
cb35ba6
Small fixes for v12/python3 standard
florian-dacosta Sep 3, 2019
6848d57
[UPD] Update sql_export.pot
oca-travis Aug 28, 2020
bb39629
Update translation files
oca-transbot Aug 28, 2020
dd96704
[UPD] Update sql_export.pot
oca-travis Nov 10, 2020
1c13114
sql_export 12.0.1.1.0
OCA-git-bot Nov 10, 2020
86b8bb6
Update translation files
oca-transbot Nov 10, 2020
3f0e917
[FIX] sql_export: fix warning two fields have same label
fernandahf Dec 16, 2020
f647ab9
[UPD] Update sql_export.pot
oca-travis Dec 16, 2020
223d549
sql_export 12.0.1.1.1
OCA-git-bot Dec 16, 2020
67bc7a9
Update translation files
oca-transbot Dec 16, 2020
e780d37
[IMP] sql_export: black, isort, prettier
florian-dacosta Mar 22, 2021
28cd7b6
Migrate to 14.0
florian-dacosta Mar 22, 2021
f47664a
Update roadmap for v15 and make some usability improvements
florian-dacosta May 20, 2021
e21807a
[UPD] Update sql_export.pot
oca-travis May 22, 2021
13a0539
[UPD] README.rst
OCA-git-bot May 22, 2021
ca0bd66
[PORT] 14.0 port #2061 : sql_export : add preview button
legalsylvain Apr 2, 2021
1431b91
[UPD] Update sql_export.pot
oca-travis Jul 28, 2021
135f406
sql_export 14.0.1.1.0
OCA-git-bot Jul 28, 2021
24e4be9
Update translation files
oca-transbot Jul 28, 2021
14d6f13
[UPD] Update sql_export.pot
oca-travis Sep 2, 2021
cae3a03
Update translation files
oca-transbot Sep 2, 2021
11e59e6
[IMP] sql_export: black, isort, prettier
mariadforgeflow Dec 2, 2021
e332c39
[MIG] sql_export: Migration to 15.0
mariadforgeflow Dec 2, 2021
3a1aaaf
[UPD] Update sql_export.pot
Feb 1, 2022
50984c4
[UPD] README.rst
OCA-git-bot Feb 1, 2022
0b4229b
Translated using Weblate (Catalan)
jabelchi Jun 15, 2022
65dc7d0
[MIG] sql_export from V15.0
legalsylvain Oct 26, 2022
077473c
[UPD] Update sql_export.pot
Nov 28, 2022
c973f5b
[UPD] README.rst
OCA-git-bot Nov 28, 2022
2f530c7
Update translation files
weblate Nov 28, 2022
dfe317f
Translated using Weblate (Spanish (Argentina))
ibuioli Dec 10, 2022
a40f02d
Translated using Weblate (Italian)
mymage Dec 28, 2022
240ad4d
Translated using Weblate (Italian)
mymage Mar 23, 2023
8464ebb
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
cc00a54
[IMP] Add back the variable feature in sql_export
florian-dacosta Feb 3, 2023
3235d44
[FIX] Fix warning removing the useless param nodestroy in sql export …
florian-dacosta Jun 5, 2023
45c8bd4
sql_export 16.0.1.0.1
OCA-git-bot Jun 16, 2023
1c44f05
[IMP] sql_export : force user to set properties to avoid server error
legalsylvain Jun 20, 2023
88580e6
Translated using Weblate (Spanish)
Ivorra78 Jul 13, 2023
697e6d4
[UPD] Update sql_export.pot
Aug 28, 2023
4c6b376
Update translation files
weblate Sep 2, 2023
173e032
[UPD] README.rst
OCA-git-bot Sep 3, 2023
1bd1e9c
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2023
3a74fc3
Translated using Weblate (Spanish)
Ivorra78 Sep 7, 2023
58c3fda
Translated using Weblate (Spanish)
Ivorra78 Sep 26, 2023
2a28b01
Update translation files
weblate Oct 9, 2023
03bb6af
[UPD] Update sql_export.pot
Oct 10, 2023
1bca144
[BOT] post-merge updates
OCA-git-bot Oct 10, 2023
79ea01f
Update translation files
weblate Oct 10, 2023
789582e
Translated using Weblate (Spanish)
Ivorra78 Oct 15, 2023
6c44ac6
Translated using Weblate (Spanish)
Ivorra78 Oct 15, 2023
253d672
[UPD] Update sql_export.pot
Oct 27, 2023
a788d4c
Update translation files
weblate Oct 29, 2023
04407cd
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 29, 2023
8d80efc
[FIX] sql_export : remove unused action parameter
florian-dacosta Nov 28, 2023
bbe878b
[BOT] post-merge updates
OCA-git-bot Nov 28, 2023
ae00716
Translated using Weblate (Italian)
mymage Dec 29, 2023
c1b1ead
[IMP] sql_export: black, isort, prettier
sanderlienaerts Jan 12, 2024
138837c
[MIG] sql_export: Migration to 17.0
sanderlienaerts Jan 15, 2024
a26ee1f
[UPD] Update sql_export.pot
Aug 2, 2024
4659c05
Translated using Weblate (Italian)
mymage Aug 5, 2024
673c6af
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 16, 2024
089901a
[IMP] sql_export: pre-commit execution
bealdav Jan 17, 2025
7fc3c03
[MIG] sql_export: Migration to 18.0
bealdav Jan 17, 2025
53c11b0
[UPD] Update sql_export.pot
Jan 22, 2025
cf57e83
[BOT] post-merge updates
OCA-git-bot Jan 22, 2025
2717970
Update translation files
weblate Jan 22, 2025
8ff2bad
Translated using Weblate (Italian)
mymage Jan 25, 2025
4fca47a
[UPD] Update sql_export.pot
Jun 21, 2025
2b27391
Update translation files
weblate Jun 21, 2025
3f01230
[IMP] sql_export : Direct download when executing the query instead o…
florian-dacosta Oct 10, 2023
11b28ad
[UPD] Update sql_export.pot
Jul 23, 2025
7cb88c9
[BOT] post-merge updates
OCA-git-bot Jul 23, 2025
508d44a
Update translation files
weblate Jul 23, 2025
b526006
[IMP] sql_export : Add last_run datetime field
florian-dacosta May 16, 2024
c26fc40
[IMP] Add last_execution_uid field + bypass orm to avoid impactif sql…
florian-dacosta May 17, 2024
390487a
[UPD] Update sql_export.pot
Jul 24, 2025
35a6ee5
[BOT] post-merge updates
OCA-git-bot Jul 24, 2025
a2280b6
Update translation files
weblate Jul 24, 2025
99afc3e
Translated using Weblate (Italian)
mymage Jul 24, 2025
cfca40e
Translated using Weblate (Turkish)
tsezgin Sep 15, 2025
ccb8d45
Translated using Weblate (Turkish)
tsezgin Sep 15, 2025
0e33bf2
[IMP] Eficent -> ForgeFlow
MiquelRForgeFlow Oct 9, 2025
761519d
[BOT] post-merge updates
OCA-git-bot Oct 14, 2025
076eeb3
[UPD] Update sql_export.pot
Apr 15, 2026
a10f3fe
Update translation files
weblate Apr 15, 2026
8142b8b
[19.0][MIG] sql_export: Migration to 19.0
Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions sql_export/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========
SQL Export
==========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4f5b18eab71ba067ea88439b72cfd484c0c761faa38f715000ea4ced8f78725c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/19.0/sql_export
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-19-0/reporting-engine-19-0-sql_export
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Allow to export data in csv files FROM sql requests. There are some
restrictions in the sql query, you can only read datas. No update,
deletion or creation are possible. A new sub menu named Sql Export is
available in the Dashboard main menu.

**Table of contents**

.. contents::
:local:

Usage
=====

Dashboards > Sql Export

**Specific use with parameters**

- %(company_id)s allows to set in the query the company id of the user
- %(user_id)s allows to set in the query the user id
- for any created property, you can use it with %(Property String)s
syntax

Known issues / Roadmap
======================

- Some words are prohibited and can't be used is the query in anyways,
even in a select query:

- delete
- drop
- insert
- alter
- truncate
- execute
- create
- update

See sql_request_abstract module to fix this issue.

- checking SQL request by execution and rollback is disabled in this
module since variables features has been introduced. This can be fixed
by overloading \_prepare_request_check_execution() function.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20sql_export%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion
* GRAP

Contributors
------------

- `Akretion <https://www.akretion.com>`__:

- Florian da Costa <florian.dacosta@akretion.com>
- Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
- Benoît GUILLOT <benoit.guillot@akretion.com>

- `ForgeFlow <https://www.forgeflow.com>`__:

- Aaron Henriquez <ahenriquez@forgeflow>

- `Codeforward <https://www.codeforward.nl>`__:

- Sander Lienaerts <sander.lienaerts@codeforward.nl>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain
.. |maintainer-florian-dacosta| image:: https://github.com/florian-dacosta.png?size=40px
:target: https://github.com/florian-dacosta
:alt: florian-dacosta

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain| |maintainer-florian-dacosta|

This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/19.0/sql_export>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sql_export/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
33 changes: 33 additions & 0 deletions sql_export/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (C) 2015 Akretion (<http://www.akretion.com>)
# @author: Florian da Costa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "SQL Export",
"version": "19.0.1.1.1",
"author": "Akretion,GRAP,Odoo Community Association (OCA)",
"maintainers": ["legalsylvain", "florian-dacosta"],
"website": "https://github.com/OCA/reporting-engine",
"license": "AGPL-3",
"category": "Generic Modules/Others",
"summary": "Export data in csv file with SQL requests",
"depends": [
"spreadsheet_dashboard",
"sql_request_abstract",
],
"data": [
"views/sql_export_view.xml",
"wizard/wizard_file_view.xml",
"security/sql_export_security.xml",
"security/ir.model.access.csv",
],
"demo": [
"demo/sql_export.xml",
],
"assets": {
"web.assets_backend": [
"sql_export/static/src/scss/modal_properties.scss",
]
},
"installable": True,
}
42 changes: 42 additions & 0 deletions sql_export/demo/sql_export.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record id="sql_export_partner" model="sql.export">
<field name="name">Export Partners (Demo Data)</field>
<field name="query"><![CDATA[
SELECT name, street
FROM res_partner;
]]>
</field>
</record>

<function
model="sql.export"
name="button_validate_sql_expression"
eval="([ref('sql_export.sql_export_partner')])"
/>

<record id="sql_export_partner_with_variables" model="sql.export">
<field name="name">Export Partners With Variables (Demo Data)</field>
<field
name="query"
><![CDATA[
SELECT p.id
FROM res_partner p
LEFT JOIN res_partner_res_partner_category_rel rel
ON rel.partner_id = p.id
WHERE create_date > %(Date)s
AND id = %(ID)s
AND rel.category_id in %(Categories)s
]]>
</field>
<field
name="query_properties_definition"
eval="[{'name': '630eca383bc142e6', 'type': 'date', 'string': 'Date'}, {'name': '907ac618eccbab74', 'type': 'integer', 'string': 'ID'}, {'name': 'ec0556e22932334b', 'string': 'Categories', 'type': 'many2many', 'default': False, 'comodel': 'res.partner.category', 'domain': False}]"
/>
</record>
</odoo>
Loading
Loading