Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b15835a
[INIT] intial import
sebastienbeau Feb 24, 2011
aabd224
Now uses an email template instead of a simple mail
davbea Jun 4, 2012
162f73a
Port to OpenERP 7.0.
Sep 29, 2013
12c7011
Generate .pot files
Mar 14, 2014
d3740d7
move all modules to __unported__ on master branch and set installable…
sbidoul Jul 12, 2014
338b307
[MIG] scheduler_error_mailer: Migration to v8
Sep 16, 2014
907d38d
[FIX] renamed 'email_template' m2o field in 'email_template_id' in sc…
bealdav Sep 15, 2014
b997d1e
[MIG][9.0] scheduler_error_mailer
atchuthan May 18, 2016
56b0630
migrate to V10
EBII Feb 3, 2017
bbbbdc0
[FIX] scheduler error mailer font typo (#765)
ateijelo Mar 21, 2017
5004ae8
[MIG] scheduler_error_mailer: Migration to 11.0
AMhadhbi Jun 21, 2018
2475c76
[12.0][MIG] scheduler_error_mailer: Migration to v12
Mar 4, 2019
1f96858
Added translation using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
3a9aecb
Translated using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
64c1584
Translated using Weblate (Portuguese (Brazil))
Aug 30, 2019
6fe3a0a
Translated using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
523c677
Translated using Weblate (Portuguese (Brazil))
Sep 2, 2019
319d321
Added translation using Weblate (French)
ypapouin Oct 20, 2021
23b7c2e
[FIX] scheduler_error_mailer: fixed email template fields
HekkiMelody Sep 14, 2021
91b2798
[IMP] scheduler_error_mailer: black, isort, prettier
victoralmau Jan 26, 2022
95a0e31
[MIG] scheduler_error_mailer: Migration to 13.0
mhachraf Feb 26, 2020
ee8172c
[UPD] Update scheduler_error_mailer.pot
oca-travis Jan 27, 2022
aa1d9df
Update translation files
oca-transbot Sep 1, 2022
1ae6aff
[IMP] scheduler_error_mailer: black, isort, prettier
ernesto-garcia-tecnativa Feb 13, 2023
709a975
[MIG] scheduler_error_mailer: Migration to 15.0
ernesto-garcia-tecnativa Feb 13, 2023
42efce0
[UPD] Update scheduler_error_mailer.pot
Feb 14, 2023
c172869
Update translation files
weblate Feb 15, 2023
8cffefc
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 4, 2023
6bee71a
[MIG] scheduler_error_mailer
hbrunn Apr 7, 2023
80f37eb
[IMP] set default template
hbrunn May 16, 2023
b977f2c
[ADD] tests
hbrunn May 16, 2023
fbe5022
[UPD] Update scheduler_error_mailer.pot
Jun 8, 2023
41ee59d
Update translation files
weblate Jun 8, 2023
0f43d11
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 9, 2023
65f5645
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
d78bcdb
[UPD] README.rst
OCA-git-bot Sep 3, 2023
82270d7
[IMP] scheduler_error_mailer: pre-commit auto fixes
cuongnmtm Dec 29, 2023
a80ed2b
[MIG] scheduler_error_mailer: Migration to 17.0
cuongnmtm Dec 29, 2023
990ad9b
[UPD] Update scheduler_error_mailer.pot
Feb 2, 2024
41c589f
Added translation using Weblate (Italian)
mymage Feb 6, 2024
c8e57fe
Translated using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Jun 16, 2024
f179437
[MIG] scheduler_error_mailer: pre-commit
astirpe Oct 17, 2024
31d81ed
[MIG] scheduler_error_mailer: migrate to V18
astirpe Oct 17, 2024
d4cee9d
[MIG] scheduler_error_mailer: reset email template body after data mo…
StefanRijnhart Apr 16, 2025
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
99 changes: 99 additions & 0 deletions scheduler_error_mailer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
======================
Scheduler Error Mailer
======================

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

.. |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/licence-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/18.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-18-0/server-tools-18-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=18.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:%2018.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/18.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": "18.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