Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
abac241
[INIT] intial import
sebastienbeau Feb 24, 2011
25df174
Now uses an email template instead of a simple mail
davbea Jun 4, 2012
b005511
Port to OpenERP 7.0.
Sep 29, 2013
952c73a
Generate .pot files
Mar 14, 2014
9fa95c6
move all modules to __unported__ on master branch and set installable…
sbidoul Jul 12, 2014
d51e172
[MIG] scheduler_error_mailer: Migration to v8
Sep 16, 2014
580ec49
[FIX] renamed 'email_template' m2o field in 'email_template_id' in sc…
bealdav Sep 15, 2014
0426b5b
[MIG][9.0] scheduler_error_mailer
atchuthan May 18, 2016
d9514ec
migrate to V10
EBII Feb 3, 2017
ba5400b
[FIX] scheduler error mailer font typo (#765)
ateijelo Mar 21, 2017
0eaf0a7
[MIG] scheduler_error_mailer: Migration to 11.0
AMhadhbi Jun 21, 2018
c739819
[12.0][MIG] scheduler_error_mailer: Migration to v12
Mar 4, 2019
eb9651d
[FIX] scheduler_error_mailer: fixed email template fields
HekkiMelody Sep 14, 2021
b660ae2
[IMP] scheduler_error_mailer: black, isort, prettier
victoralmau Jan 26, 2022
c3e9be2
[MIG] scheduler_error_mailer: Migration to 13.0
mhachraf Feb 26, 2020
873a070
[IMP] scheduler_error_mailer: black, isort, prettier
ernesto-garcia-tecnativa Feb 13, 2023
e98a446
[MIG] scheduler_error_mailer: Migration to 15.0
ernesto-garcia-tecnativa Feb 13, 2023
fcc42c1
[MIG] scheduler_error_mailer
hbrunn Apr 7, 2023
8f239ce
[IMP] set default template
hbrunn May 16, 2023
7235347
[ADD] tests
hbrunn May 16, 2023
8df6a2f
[IMP] scheduler_error_mailer: pre-commit auto fixes
cuongnmtm Dec 29, 2023
17e0bc4
[MIG] scheduler_error_mailer: Migration to 17.0
cuongnmtm Dec 29, 2023
33fb692
[MIG] scheduler_error_mailer: pre-commit
astirpe Oct 17, 2024
1571286
[MIG] scheduler_error_mailer: migrate to V18
astirpe Oct 17, 2024
5b5337b
[MIG] scheduler_error_mailer: reset email template body after data mo…
StefanRijnhart Apr 16, 2025
43b42d4
[IMP] scheduler_error_mailer: pre-commit execution
quoc-pn Jan 24, 2026
da5b58b
[MIG] scheduler_error_mailer: Migration to 19.0
quoc-pn Jan 26, 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
103 changes: 103 additions & 0 deletions scheduler_error_mailer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

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

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

.. |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%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/19.0/scheduler_error_mailer
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-19-0/server-tools-19-0-scheduler_error_mailer
: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/server-tools&target_branch=19.0
:alt: Try me on Runboat

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

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

**Table of contents**

.. contents::
:local:

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

To configure this module, you need to:

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

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20scheduler_error_mailer%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
* Sodexis

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

- Sébastien BEAU <sebastien.beau@akretion.com>
- David Beal <bealdavid@gmail.com>
- Alexis de Lattre <alexis.delattre@akretion.com>
- Sodexis <dev@sodexis.com>
- Achraf Mhadhbi <machraf@bloopark.de>
- `Tecnativa <https://www.tecnativa.com>`__:

- Cristina Martin R.
- Víctor Martínez

- `Komit <https://komit-consulting.com>`__:

- Cuong NGUYEN MINH TRAN MANH

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.

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/19.0/scheduler_error_mailer>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions scheduler_error_mailer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from .hooks import post_init_hook
20 changes: 20 additions & 0 deletions scheduler_error_mailer/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre
# Copyright 2016 Sodexis
# Copyright 2018 bloopark systems (<http://bloopark.de>)
# Copyright 2019 Tecnativa - Cristina Martin R.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Scheduler Error Mailer",
"version": "19.0.1.0.0",
"category": "Extra Tools",
"license": "AGPL-3",
"author": "Akretion,Sodexis,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools",
"depends": ["mail"],
"data": ["data/ir_cron_email_tpl.xml", "views/ir_cron.xml"],
"demo": ["demo/ir_cron_demo.xml"],
"images": ["images/scheduler_error_mailer.jpg"],
"installable": True,
"post_init_hook": "post_init_hook",
}
42 changes: 42 additions & 0 deletions scheduler_error_mailer/data/ir_cron_email_tpl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo 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: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">

<p>Odoo tried to run the scheduler <em><t t-out="object.name or ''"/></em> in the database <em><t t-out="ctx.get('dbname')"/></em> but it failed. Here is the error message :</p>

<strong>
<t t-out="ctx.get('job_exception') or 'Failed to get the error message from the context.'"/>
</strong>

<p>You may check the logs of the Odoo server to get more information about this failure.</p>

<p>Properties of the scheduler <em><t t-out="object.name or ''"/></em> :</p>
<ul>
<li>Model : <t t-out="object.model_id.name or ''"/></li>
<li>Python code : <code><t t-out="object.code or ''"/></code></li>
<li>Interval : <t t-out="object.interval_number or '0'"/> <t t-out="object.interval_type or ''"/></li>
<li>User : <t t-out="object.user_id.name or ''"/></li>
</ul>

<p>
-- <br/>
Automatic e-mail sent by Odoo. Do not reply.<br/>
Database : <t t-out="ctx.get('dbname')"/>
</p>
</div>
]]>
</field>
</record>
</odoo>
24 changes: 24 additions & 0 deletions scheduler_error_mailer/demo/ir_cron_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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
Copyright (C) 2018 bloopark systems (<http://bloopark.de>)
The licence is in the file __openerp__.py
-->
<odoo 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="model_id" ref="model_ir_cron" />
<field name="state">code</field>
<field name="code">model._test_scheduler_failure()</field>
<field
name="email_template_id"
ref="scheduler_error_mailer.scheduler_error_mailer"
/>
</record>
</odoo>
14 changes: 14 additions & 0 deletions scheduler_error_mailer/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Hunki Enterprises BV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api


def post_init_hook(env):
env = api.Environment(env.cr, SUPERUSER_ID, {})
env["ir.cron"].with_context(active_test=False).search([]).write(
{
"email_template_id": env.ref(
"scheduler_error_mailer.scheduler_error_mailer"
).id
}
)
110 changes: 110 additions & 0 deletions scheduler_error_mailer/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * scheduler_error_mailer
#
# Translators:
# Niki Waibel <niki.waibel@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-08 03:37+0000\n"
"PO-Revision-Date: 2017-02-08 03:37+0000\n"
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: scheduler_error_mailer
#: model:mail.template,body_html:scheduler_error_mailer.scheduler_error_mailer
msgid ""
"\n"
" \n"
"<div style=\"font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-"
"serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
"\n"
"<p>Odoo tried to run the scheduler <em><t t-out=\"object.name or ''\"/></em> "
"in the database <em><t t-out=\"ctx.get('dbname')\"/></em> but it failed. "
"Here is the error message :</p>\n"
"\n"
"<strong>\n"
"<t t-out=\"ctx.get('job_exception') or 'Failed to get the error message from "
"the context.'\"/>\n"
"</strong>\n"
"\n"
"<p>You may check the logs of the Odoo server to get more information about "
"this failure.</p>\n"
"\n"
"<p>Properties of the scheduler <em><t t-out=\"object.name or ''\"/></em> :</"
"p>\n"
"<ul>\n"
"<li>Model : <t t-out=\"object.model_id.name or ''\"/></li>\n"
"<li>Python code : <code><t t-out=\"object.code or ''\"/></code></li>\n"
"<li>Interval : <t t-out=\"object.interval_number or '0'\"/> <t t-out="
"\"object.interval_type or ''\"/></li>\n"
"<li>Number of calls : <t t-out=\"object.numbercall or '0'\"/></li>\n"
"<li>Repeat missed : <t t-out=\"object.doall\"/></li>\n"
"<li>User : <t t-out=\"object.user_id.name or ''\"/></li>\n"
"</ul>\n"
"\n"
"<p>\n"
"-- <br/>\n"
"Automatic e-mail sent by Odoo. Do not reply.<br/>\n"
"Database : <t t-out=\"ctx.get('dbname')\"/>\n"
"</p>\n"
"</div>\n"
" \n"
" "
msgstr ""

#. module: scheduler_error_mailer
#: model:ir.model.fields,field_description:scheduler_error_mailer.field_ir_cron__email_template_id
msgid "Error E-mail Template"
msgstr "Fehler e-Mail Vorlage"

#. module: scheduler_error_mailer
#: model:ir.model,name:scheduler_error_mailer.model_ir_cron
msgid "Scheduled Actions"
msgstr ""

#. module: scheduler_error_mailer
#: model:mail.template,name:scheduler_error_mailer.scheduler_error_mailer
msgid "Scheduler Error"
msgstr ""

#. module: scheduler_error_mailer
#: model:ir.model.fields,help:scheduler_error_mailer.field_ir_cron__email_template_id
msgid "Select the email template that will be sent when this scheduler fails."
msgstr ""
"Wähle die e-Mail Vorlage welche bei einem Fehler dieses Schedulers gesendet "
"wird."

#. module: scheduler_error_mailer
#. odoo-python
#: code:addons/scheduler_error_mailer/models/ir_cron.py:0
#, python-format
msgid "Task failure with UID = %d."
msgstr "Task Fehler von UID = %d."

#. module: scheduler_error_mailer
#: model:ir.actions.server,name:scheduler_error_mailer.test_scheduler_error_mailer_ir_actions_server
msgid "Test Scheduler Error Mailer"
msgstr ""

#. module: scheduler_error_mailer
#: model:mail.template,subject:scheduler_error_mailer.scheduler_error_mailer
msgid "[DB {{ctx.get('dbname')}}] Scheduler '{{object.name or ''}}' FAILED"
msgstr ""

#~ msgid "[DB ${ctx.get('dbname')}] Scheduler '${object.name or ''}' FAILED"
#~ msgstr "[DB ${ctx.get('dbname')}] Scheduler '${object.name or ''}' FEHLER"

#, fuzzy
#~ msgid "Email Template"
#~ msgstr "Fehler e-Mail Vorlage"

#~ msgid "ir.cron"
#~ msgstr "ir.cron"
Loading