Skip to content

Commit 92f4ea0

Browse files
florian-dacostalegalsylvain
authored andcommitted
Add module sql_export_mail
1 parent d5a95d8 commit 92f4ea0

14 files changed

+672
-0
lines changed

sql_export_mail/README.rst

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2+
:alt: License: AGPL-3
3+
4+
SQL Export Mail
5+
===============
6+
7+
Allow to send the result of a query (made with the module sql_export) by mail.
8+
9+
10+
Configuration
11+
=============
12+
13+
To configure this module, you need to:
14+
15+
#. Go to the sql query for which you want users to be notified by e-mail.
16+
#. Add users to be notified in the field Users Notified by e-mail.
17+
#. Click on the button create a cron and then configure the cron to run when
18+
you want to. If you already have created a cron for another query, you can
19+
use it again for other queries
20+
21+
Usage
22+
=====
23+
24+
To use this module, you need to:
25+
26+
#. Go to ...
27+
28+
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
29+
:alt: Try me on Runbot
30+
:target: https://runbot.odoo-community.org/runbot/149/10.0
31+
32+
Bug Tracker
33+
===========
34+
35+
Bugs are tracked on `GitHub Issues
36+
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
37+
check there if your issue has already been reported. If you spotted it first,
38+
help us smash it by providing detailed and welcomed feedback.
39+
40+
Credits
41+
=======
42+
43+
Images
44+
------
45+
46+
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
47+
48+
Contributors
49+
------------
50+
51+
* Florian da Costa <[email protected]>
52+
53+
Maintainer
54+
----------
55+
56+
.. image:: https://odoo-community.org/logo.png
57+
:alt: Odoo Community Association
58+
:target: https://odoo-community.org
59+
60+
This module is maintained by the OCA.
61+
62+
OCA, or the Odoo Community Association, is a nonprofit organization whose
63+
mission is to support the collaborative development of Odoo features and
64+
promote its widespread use.
65+

sql_export_mail/__init__.py

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

sql_export_mail/__openerp__.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
##############################################################################
3+
#
4+
# OpenERP, Open Source Management Solution
5+
# Copyright (C) 2015 Akretion (<http://www.akretion.com>).
6+
#
7+
# This program is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Affero General Public License as
9+
# published by the Free Software Foundation, either version 3 of the
10+
# License, or (at your option) any later version.
11+
#
12+
# This program is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU Affero General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Affero General Public License
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
#
20+
##############################################################################
21+
22+
{
23+
'name': 'SQL Export Mail',
24+
'version': '8.0.1.0.0',
25+
'author': 'Akretion,Odoo Community Association (OCA)',
26+
'website': 'http://www.akretion.com',
27+
'license': 'AGPL-3',
28+
'category': 'Generic Modules/Others',
29+
'summary': 'Export data in csv file with SQL requests',
30+
'depends': [
31+
'sql_export',
32+
'mail',
33+
],
34+
'data': [
35+
'views/sql_export_view.xml',
36+
'mail_template.xml',
37+
],
38+
'installable': True,
39+
}

sql_export_mail/i18n/fr.po

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sql_export_mail
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 8.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2017-07-18 13:15+0000\n"
10+
"PO-Revision-Date: 2017-07-18 13:15+0000\n"
11+
"Last-Translator: <>\n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: sql_export_mail
19+
#: model:email.template,body_html:sql_export_mail.sql_export_mailer
20+
msgid "\n"
21+
"<div style=\"font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
22+
"\n"
23+
"<p>You will find the report ${object.name or ''} as an attachment of the mail.</p>\n"
24+
"\n"
25+
"</div>\n"
26+
" "
27+
msgstr "\n"
28+
"<div style=\"font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
29+
"\n"
30+
"<p>Vous trouverez le rapport ${object.name or ''} en pièce jointe de ce mail.</p>\n"
31+
"\n"
32+
"</div>\n"
33+
" "
34+
35+
#. module: sql_export_mail
36+
#: model:email.template,subject:sql_export_mail.sql_export_mailer
37+
msgid "${object.name or ''}"
38+
msgstr "${object.name or ''}"
39+
40+
#. module: sql_export_mail
41+
#: help:sql.export,mail_user_ids:0
42+
msgid "Add the users who want to receive the report by e-mail. You need to link the sql query with a cron to send mail automatically"
43+
msgstr "Ajoutez les utilisateurs voulant recevoir le rapport par mail. Vous devez ensuite créer une tâche planifiée pour envoyer le mail automatiquement."
44+
45+
#. module: sql_export_mail
46+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
47+
msgid "Create Cron"
48+
msgstr "Créer une tâche planfiée"
49+
50+
#. module: sql_export_mail
51+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_cron_ids
52+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
53+
#: field:sql.export,cron_ids:0
54+
msgid "Crons"
55+
msgstr "Tâches planifiées"
56+
57+
#. module: sql_export_mail
58+
#: selection:sql.export,mail_condition:0
59+
msgid "File Not Empty"
60+
msgstr "Fichier non vide."
61+
62+
#. module: sql_export_mail
63+
#: code:addons/sql_export_mail/models/sql_export.py:126
64+
#, python-format
65+
msgid "It is not possible to execute and send a query automatically by e-mail if there are parameters to fill"
66+
msgstr "Il n'est pas possible d'exécuter en envoyer le résultat d'une requête par mail si celle-ci contient des paramètres."
67+
68+
#. module: sql_export_mail
69+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_mail_condition
70+
#: field:sql.export,mail_condition:0
71+
msgid "Mail condition"
72+
msgstr "Condition d'envoi par mail"
73+
74+
#. module: sql_export_mail
75+
#: model:ir.model,name:sql_export_mail.model_sql_export
76+
msgid "SQL export"
77+
msgstr "Export SQL"
78+
79+
#. module: sql_export_mail
80+
#: code:addons/sql_export_mail/models/sql_export.py:135
81+
#, python-format
82+
msgid "The user does not have any e-mail address."
83+
msgstr "L'utilisateur selectionné n'a pas d'addresse mail."
84+
85+
#. module: sql_export_mail
86+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_mail_user_ids
87+
#: field:sql.export,mail_user_ids:0
88+
msgid "User to notify"
89+
msgstr "Utilisateurs à notifier par mail"
90+
91+
#. module: sql_export_mail
92+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
93+
msgid "Users Notified by e-mail"
94+
msgstr "Utilisateurs notifiés par mail"
+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sql_export_mail
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 8.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2017-07-18 13:24+0000\n"
10+
"PO-Revision-Date: 2017-07-18 13:24+0000\n"
11+
"Last-Translator: <>\n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: sql_export_mail
19+
#: model:email.template,body_html:sql_export_mail.sql_export_mailer
20+
msgid "\n"
21+
"<div style=\"font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
22+
"\n"
23+
"<p>You will find the report ${object.name or ''} as an attachment of the mail.</p>\n"
24+
"\n"
25+
"</div>\n"
26+
" "
27+
msgstr ""
28+
29+
#. module: sql_export_mail
30+
#: model:email.template,subject:sql_export_mail.sql_export_mailer
31+
msgid "${object.name or ''}"
32+
msgstr ""
33+
34+
#. module: sql_export_mail
35+
#: help:sql.export,mail_user_ids:0
36+
msgid "Add the users who want to receive the report by e-mail. You need to link the sql query with a cron to send mail automatically"
37+
msgstr ""
38+
39+
#. module: sql_export_mail
40+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
41+
msgid "Create Cron"
42+
msgstr ""
43+
44+
#. module: sql_export_mail
45+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_cron_ids
46+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
47+
#: field:sql.export,cron_ids:0
48+
msgid "Crons"
49+
msgstr ""
50+
51+
#. module: sql_export_mail
52+
#: selection:sql.export,mail_condition:0
53+
msgid "File Not Empty"
54+
msgstr ""
55+
56+
#. module: sql_export_mail
57+
#: code:addons/sql_export_mail/models/sql_export.py:126
58+
#, python-format
59+
msgid "It is not possible to execute and send a query automatically by e-mail if there are parameters to fill"
60+
msgstr ""
61+
62+
#. module: sql_export_mail
63+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_mail_condition
64+
#: field:sql.export,mail_condition:0
65+
msgid "Mail condition"
66+
msgstr ""
67+
68+
#. module: sql_export_mail
69+
#: model:ir.model,name:sql_export_mail.model_sql_export
70+
msgid "SQL export"
71+
msgstr ""
72+
73+
#. module: sql_export_mail
74+
#: code:addons/sql_export_mail/models/sql_export.py:135
75+
#, python-format
76+
msgid "The user does not have any e-mail address."
77+
msgstr ""
78+
79+
#. module: sql_export_mail
80+
#: model:ir.model.fields,field_description:sql_export_mail.field_sql_export_mail_user_ids
81+
#: field:sql.export,mail_user_ids:0
82+
msgid "User to notify"
83+
msgstr ""
84+
85+
#. module: sql_export_mail
86+
#: view:sql.export:sql_export_mail.sql_export_mail_view_form
87+
msgid "Users Notified by e-mail"
88+
msgstr ""
89+

sql_export_mail/mail_template.xml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2017 Akretion (http://www.akretion.com/)
4+
The licence is in the file __openerp__.py
5+
-->
6+
7+
<openerp>
8+
<data noupdate="1">
9+
10+
<!-- Error Email template -->
11+
<record id="sql_export_mailer" model="email.template">
12+
<field name="name">SQL Export</field>
13+
<field name="email_from">[email protected]</field>
14+
<field name="email_to">${object.get_email_address_for_template()}</field>
15+
<field name="subject">${object.name or ''}</field>
16+
<field name="model_id" ref="sql_export.model_sql_export"/>
17+
<field name="auto_delete" eval="True"/>
18+
<field name="body_html"><![CDATA[
19+
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
20+
21+
<p>You will find the report ${object.name or ''} as an attachment of the mail.</p>
22+
23+
</div>
24+
]]></field>
25+
</record>
26+
27+
</data>
28+
</openerp>

sql_export_mail/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import sql_export

0 commit comments

Comments
 (0)