Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 67 additions & 0 deletions scheduler_error_mailer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

======================
Scheduler Error Mailer
======================

This module adds the possibility to send an e-mail when a scheduler raises
an error.

Configuration
=============

To configure this module, you need to:

#. Go to Settings -> Technical -> Automation -> Scheduled Actions
#. Choose the scheduled Actions you want to send the error email and select the E-mail Template in the Error E-mail Template field.

Usage
=====

To use this module, you need to:

.. 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/9.0

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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

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

* Sébastien BEAU <sebastien.beau@akretion.com>
* David Beal <bealdavid@gmail.com>
* Alexis de Lattre <alexis.delattre@akretion.com>
* Sodexis <dev@sodexis.com>


Maintainer
----------

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

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
26 changes: 4 additions & 22 deletions scheduler_error_mailer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Scheduler Error Mailer module for OpenERP
# Copyright (C) 2012-2013 Akretion (http://www.akretion.com/)
# @author: Sébastien Beau <sebastien.beau@akretion.com>
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
# © 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import ir_cron
from . import models
49 changes: 11 additions & 38 deletions scheduler_error_mailer/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Scheduler Error Mailer module for OpenERP
# Copyright (C) 2012-2013 Akretion (http://www.akretion.com/)
# @author: Sébastien Beau <sebastien.beau@akretion.com>
# @author David Beal <bealdavid@gmail.com>
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

# -*- coding: utf-8 -*-
# © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
# © 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Scheduler Error Mailer',
'summary': 'Send an e-mail when a scheduler fails',
'version': '8.0.1.0.0',
'version': '9.0.1.0.0',
'category': 'Extra Tools',
'license': 'AGPL-3',
'description': """
Scheduler Error Mailer
======================

This module adds the possibility to send an e-mail when a scheduler raises
an error.""",
'author': "Akretion,Odoo Community Association (OCA)",
'author': "Akretion,Sodexis,Odoo Community Association (OCA)",
'website': 'http://www.akretion.com/',
'depends': ['email_template'],
'depends': ['mail'],
'data': [
'ir_cron.xml',
'ir_cron_email_tpl.xml',
'data/ir_cron_email_tpl.xml',
'views/ir_cron.xml',
],
'demo': ['ir_cron_demo.xml'],
'demo': ['demo/ir_cron_demo.xml'],
'images': ['images/scheduler_error_mailer.jpg'],
'installable': False,
'installable': True,
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012-2013 Akretion (http://www.akretion.com/)
scheduler_error_mailer for Odoo
Copyright (C) 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
Copyright (C) 2016 Sodexis
The licence is in the file __openerp__.py
-->

<openerp>
<data noupdate="1">

<!-- Error Email template -->
<record id="scheduler_error_mailer" model="email.template">
<field name="name">Scheduler Error</field>
<field name="email_from">${object.user_id.user_email or ''}</field>
<field name="email_to">${object.user_id.user_email or ''}</field>
<field name="subject">[DB ${ctx.get('dbname')}] Scheduler '${object.name or ''}' FAILED</field>
<field name="model_id" ref="base.model_ir_cron"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<odoo>
<data noupdate="1">

<!-- Error Email template -->
<record id="scheduler_error_mailer" model="mail.template">
<field name="name">Scheduler Error</field>
<field name="email_from">${object.user_id.email or ''}</field>
<field name="email_to">${object.user_id.email or ''}</field>
<field name="subject">[DB ${ctx.get('dbname')}] Scheduler '${object.name or ''}' FAILED</field>
<field name="model_id" ref="base.model_ir_cron"/>
<field name="auto_delete" eval="True"/>
<field name="body_html">
<![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">

<p>OpenERP tried to run the scheduler <em>${object.name or ''}</em> in the database <em>${ctx.get('dbname')}</em> but it failed. Here is the error message :</p>
Expand Down Expand Up @@ -43,8 +46,9 @@ Automatic e-mail sent by OpenERP. Do not reply.<br/>
Database : ${ctx.get('dbname')}
</p>
</div>
]]></field>
</record>
]]>
</field>
</record>

</data>
</openerp>
</data>
</odoo>
27 changes: 27 additions & 0 deletions scheduler_error_mailer/demo/ir_cron_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
scheduler_error_mailer for Odoo
Copyright (C) 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
Copyright (C) 2016 Sodexis
The licence is in the file __openerp__.py
-->

<odoo>
<data noupdate="1">

<record id="test_scheduler_error_mailer" model="ir.cron">
<field name="name">Test Scheduler Error Mailer</field>
<field name="active" eval="False"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<!-- don't limit the number of calls -->
<field name="doall" eval="True"/>
<field name="model">ir.cron</field>
<field name="function">_test_scheduler_failure</field>
<field name="email_template_id" ref="scheduler_error_mailer.scheduler_error_mailer"/>
</record>

</data>
</odoo>
76 changes: 0 additions & 76 deletions scheduler_error_mailer/ir_cron.py

This file was deleted.

24 changes: 0 additions & 24 deletions scheduler_error_mailer/ir_cron.xml

This file was deleted.

26 changes: 0 additions & 26 deletions scheduler_error_mailer/ir_cron_demo.xml

This file was deleted.

6 changes: 6 additions & 0 deletions scheduler_error_mailer/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
# © 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import ir_cron
Loading