diff --git a/sql_export/README.rst b/sql_export/README.rst index 0bf6f8497..745ef7030 100644 --- a/sql_export/README.rst +++ b/sql_export/README.rst @@ -5,14 +5,15 @@ SQL Export ========== Allow to export data in csv files FROM sql requests. -There are some restrictions in the sql sql request, you can only read datas. +There are some restrictions in the sql query, you can only read datas. No update, deletion or creation are possible. A new menu named Export is created. Known issues / Roadmap ====================== -* Some words are prohibeted and can't be used is the query in anyways, even in a select query : +* Some words are prohibeted and can't be used is the query in anyways, even in + a select query : * delete * drop * insert @@ -28,6 +29,14 @@ See sql_request_abstract module to fix this issue. since variables features has been introduced. This can be fixed by overloading _prepare_request_check_execution() function. +Usage +===== + +Dashboards > Sql Export. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/149/10.0 Bug Tracker =========== diff --git a/sql_export/__init__.py b/sql_export/__init__.py index 9b4296142..408a6001b 100644 --- a/sql_export/__init__.py +++ b/sql_export/__init__.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- from . import models from . import wizard diff --git a/sql_export/__manifest__.py b/sql_export/__manifest__.py new file mode 100644 index 000000000..20eb4f992 --- /dev/null +++ b/sql_export/__manifest__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2015 Akretion () +# @author: Florian da Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'SQL Export', + 'version': '10.0.1.0.0', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'license': 'AGPL-3', + 'category': 'Generic Modules/Others', + 'summary': 'Export data in csv file with SQL requests', + 'depends': [ + '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', + ], + 'installable': True, + } diff --git a/sql_export/__openerp__.py b/sql_export/__openerp__.py deleted file mode 100644 index 853739166..000000000 --- a/sql_export/__openerp__.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Akretion (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'SQL Export', - 'version': '9.0.1.0.0', - 'author': 'Akretion,Odoo Community Association (OCA)', - 'website': 'http://www.akretion.com', - 'license': 'AGPL-3', - 'category': 'Generic Modules/Others', - 'summary': 'Export data in csv file with SQL requests', - 'depends': [ - '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', - ], - 'installable': True, - } diff --git a/sql_export/demo/sql_export.xml b/sql_export/demo/sql_export.xml index 4e168a505..fa1268bc7 100644 --- a/sql_export/demo/sql_export.xml +++ b/sql_export/demo/sql_export.xml @@ -5,7 +5,7 @@ Copyright (C) 2017 - Today: GRAP (http://www.grap.coop) License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> - + Export Partners (Demo Data) @@ -14,4 +14,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - + diff --git a/sql_export/models/__init__.py b/sql_export/models/__init__.py index 014462062..e7dd6865e 100644 --- a/sql_export/models/__init__.py +++ b/sql_export/models/__init__.py @@ -1 +1,3 @@ +# -*- coding: utf-8 -*- + from . import sql_export diff --git a/sql_export/models/sql_export.py b/sql_export/models/sql_export.py index 0cdf5bc76..c1c9dc212 100644 --- a/sql_export/models/sql_export.py +++ b/sql_export/models/sql_export.py @@ -1,25 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Akretion (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields, api +# Copyright (C) 2015 Akretion () +# @author: Florian da Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models, fields, api class SqlExport(models.Model): diff --git a/sql_export/security/sql_export_security.xml b/sql_export/security/sql_export_security.xml index af5cea3a4..7bc29279a 100644 --- a/sql_export/security/sql_export_security.xml +++ b/sql_export/security/sql_export_security.xml @@ -1,6 +1,5 @@ - - + SQL Export users and groups rules @@ -12,5 +11,4 @@ ['|', ('user_ids','=',user.id), ('group_ids','in', [x.id for x in user.groups_id])] - - + diff --git a/sql_export/tests/__init__.py b/sql_export/tests/__init__.py index db699b61a..8b2b9c21f 100644 --- a/sql_export/tests/__init__.py +++ b/sql_export/tests/__init__.py @@ -1,2 +1,3 @@ # -*- coding: utf-8 -*- + from . import test_sql_query diff --git a/sql_export/tests/test_sql_query.py b/sql_export/tests/test_sql_query.py index ffcd4d2ad..1d7652065 100644 --- a/sql_export/tests/test_sql_query.py +++ b/sql_export/tests/test_sql_query.py @@ -4,8 +4,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import base64 -from openerp.tests.common import TransactionCase -from openerp.exceptions import Warning as UserError +from odoo.tests.common import TransactionCase +from odoo.exceptions import Warning as UserError class TestExportSqlQuery(TransactionCase): diff --git a/sql_export/views/sql_export_view.xml b/sql_export/views/sql_export_view.xml index 3fb33f9fb..53ac7f4f0 100644 --- a/sql_export/views/sql_export_view.xml +++ b/sql_export/views/sql_export_view.xml @@ -1,47 +1,44 @@ - - - - + Sql_export_form_view sql.export
+
+
-
-
- -

- -

-
- - - - - - - - - - - - - + +

+ +

+
+ + + - - + + + + + + + + + + + + - +
@@ -55,7 +52,7 @@