Skip to content

Commit 8576271

Browse files
committed
Merge PR #967 into 18.0
Signed-off-by rvalyi
2 parents b8fc308 + e387ac8 commit 8576271

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+28650
-0
lines changed

sql_export/README.rst

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
==========
2+
SQL Export
3+
==========
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:2cf03bbe1b27b9015fc6d1d57ce5b9b14951c00861e9d8518343c66a2c0b14cc
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
20+
:target: https://github.com/OCA/reporting-engine/tree/18.0/sql_export
21+
:alt: OCA/reporting-engine
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-sql_export
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Allow to export data in csv files FROM sql requests. There are some
32+
restrictions in the sql query, you can only read datas. No update,
33+
deletion or creation are possible. A new sub menu named Sql Export is
34+
available in the Dashboard main menu.
35+
36+
**Table of contents**
37+
38+
.. contents::
39+
:local:
40+
41+
Usage
42+
=====
43+
44+
Dashboards > Sql Export
45+
46+
**Specific use with parameters**
47+
48+
- %(company_id)s allows to set in the query the company id of the user
49+
- %(user_id)s allows to set in the query the user id
50+
- for any created property, you can use it with %(Property String)s
51+
syntax
52+
53+
Known issues / Roadmap
54+
======================
55+
56+
- Some words are prohibited and can't be used is the query in anyways,
57+
even in a select query:
58+
59+
- delete
60+
- drop
61+
- insert
62+
- alter
63+
- truncate
64+
- execute
65+
- create
66+
- update
67+
68+
See sql_request_abstract module to fix this issue.
69+
70+
- checking SQL request by execution and rollback is disabled in this
71+
module since variables features has been introduced. This can be
72+
fixed by overloading \_prepare_request_check_execution() function.
73+
74+
Bug Tracker
75+
===========
76+
77+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
78+
In case of trouble, please check there if your issue has already been reported.
79+
If you spotted it first, help us to smash it by providing a detailed and welcomed
80+
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20sql_export%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
81+
82+
Do not contact contributors directly about support or help with technical issues.
83+
84+
Credits
85+
=======
86+
87+
Authors
88+
-------
89+
90+
* Akretion
91+
* GRAP
92+
93+
Contributors
94+
------------
95+
96+
- `Akretion <https://www.akretion.com>`__:
97+
98+
- Florian da Costa <florian.dacosta@akretion.com>
99+
- Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
100+
- Benoît GUILLOT <benoit.guillot@akretion.com>
101+
102+
- `Eficent <https://www.eficent.com>`__:
103+
104+
- Aaron Henriquez <ahenriquez@eficent.com>
105+
106+
- `Codeforward <https://www.codeforward.nl>`__:
107+
108+
- Sander Lienaerts <sander.lienaerts@codeforward.nl>
109+
110+
Maintainers
111+
-----------
112+
113+
This module is maintained by the OCA.
114+
115+
.. image:: https://odoo-community.org/logo.png
116+
:alt: Odoo Community Association
117+
:target: https://odoo-community.org
118+
119+
OCA, or the Odoo Community Association, is a nonprofit organization whose
120+
mission is to support the collaborative development of Odoo features and
121+
promote its widespread use.
122+
123+
.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
124+
:target: https://github.com/legalsylvain
125+
:alt: legalsylvain
126+
127+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
128+
129+
|maintainer-legalsylvain|
130+
131+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/sql_export>`_ project on GitHub.
132+
133+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

sql_export/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizard

sql_export/__manifest__.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (C) 2015 Akretion (<http://www.akretion.com>)
2+
# @author: Florian da Costa
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
{
6+
"name": "SQL Export",
7+
"version": "18.0.1.0.0",
8+
"author": "Akretion,GRAP,Odoo Community Association (OCA)",
9+
"maintainers": ["legalsylvain", "florian-dacosta"],
10+
"website": "https://github.com/OCA/reporting-engine",
11+
"license": "AGPL-3",
12+
"category": "Generic Modules/Others",
13+
"summary": "Export data in csv file with SQL requests",
14+
"depends": [
15+
"spreadsheet_dashboard",
16+
"sql_request_abstract",
17+
],
18+
"data": [
19+
"views/sql_export_view.xml",
20+
"wizard/wizard_file_view.xml",
21+
"security/sql_export_security.xml",
22+
"security/ir.model.access.csv",
23+
],
24+
"demo": [
25+
"demo/sql_export.xml",
26+
],
27+
"assets": {
28+
"web.assets_backend": [
29+
"sql_export/static/src/scss/modal_properties.scss",
30+
]
31+
},
32+
"installable": True,
33+
}

sql_export/demo/sql_export.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
4+
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
6+
-->
7+
<odoo>
8+
<record id="sql_export_partner" model="sql.export">
9+
<field name="name">Export Partners (Demo Data)</field>
10+
<field name="query"><![CDATA[
11+
SELECT name, street
12+
FROM res_partner;
13+
]]>
14+
</field>
15+
</record>
16+
17+
<function
18+
model="sql.export"
19+
name="button_validate_sql_expression"
20+
eval="([ref('sql_export.sql_export_partner')])"
21+
/>
22+
23+
<record id="sql_export_partner_with_variables" model="sql.export">
24+
<field name="name">Export Partners With Variables (Demo Data)</field>
25+
<field
26+
name="query"
27+
><![CDATA[
28+
SELECT p.id
29+
FROM res_partner p
30+
LEFT JOIN res_partner_res_partner_category_rel rel
31+
ON rel.partner_id = p.id
32+
WHERE create_date > %(Date)s
33+
AND id = %(ID)s
34+
AND rel.category_id in %(Categories)s
35+
]]>
36+
</field>
37+
<field
38+
name="query_properties_definition"
39+
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}]"
40+
/>
41+
</record>
42+
</odoo>

0 commit comments

Comments
 (0)