Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18.0 mig scheduler error mailer #3192

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b56af0b
[INIT] intial import
sebastienbeau Feb 24, 2011
4feaebc
Now uses an email template instead of a simple mail
davbea Jun 4, 2012
713b454
Port to OpenERP 7.0.
Sep 29, 2013
05caa11
Generate .pot files
Mar 14, 2014
8884082
move all modules to __unported__ on master branch and set installable…
sbidoul Jul 12, 2014
94d3205
[MIG] scheduler_error_mailer: Migration to v8
Sep 16, 2014
5a5eaa6
[FIX] renamed 'email_template' m2o field in 'email_template_id' in sc…
bealdav Sep 15, 2014
2e22347
[MIG][9.0] scheduler_error_mailer
atchuthan May 18, 2016
c9f6c4f
migrate to V10
EBII Feb 3, 2017
c96501e
[FIX] scheduler error mailer font typo (#765)
ateijelo Mar 21, 2017
c5c753e
[MIG] scheduler_error_mailer: Migration to 11.0
AMhadhbi Jun 21, 2018
d230b7a
[12.0][MIG] scheduler_error_mailer: Migration to v12
cristinamartinrod Mar 4, 2019
6d59091
Added translation using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
a382b98
Translated using Weblate (Portuguese)
pedrocs-exo Aug 14, 2019
bc6fc53
Translated using Weblate (Portuguese (Brazil))
Aug 30, 2019
dfe8844
Translated using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
1cfd3cb
Translated using Weblate (Portuguese (Brazil))
Sep 2, 2019
1406c0d
Added translation using Weblate (French)
ypapouin Oct 20, 2021
f9fe053
[FIX] scheduler_error_mailer: fixed email template fields
aleuffre Sep 14, 2021
de7ca9c
[IMP] scheduler_error_mailer: black, isort, prettier
victoralmau Jan 26, 2022
a76ab85
[MIG] scheduler_error_mailer: Migration to 13.0
mhachraf Feb 26, 2020
5df562d
[UPD] Update scheduler_error_mailer.pot
oca-travis Jan 27, 2022
b244d5f
[UPD] README.rst
OCA-git-bot Jan 27, 2022
bd9807a
[UPD] Update scheduler_error_mailer.pot
oca-travis Sep 1, 2022
ca350ab
Update translation files
oca-transbot Sep 1, 2022
c5d906b
[IMP] scheduler_error_mailer: black, isort, prettier
ernesto-garcia-tecnativa Feb 13, 2023
6813e2a
[MIG] scheduler_error_mailer: Migration to 15.0
ernesto-garcia-tecnativa Feb 13, 2023
d87c3ce
[UPD] Update scheduler_error_mailer.pot
Feb 14, 2023
ead7243
[UPD] README.rst
OCA-git-bot Feb 14, 2023
65a15fe
Update translation files
weblate Feb 15, 2023
9ac4a27
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 4, 2023
beb51ff
[MIG] scheduler_error_mailer
hbrunn Apr 7, 2023
37f230b
[IMP] set default template
hbrunn May 16, 2023
4d1d52d
[ADD] tests
hbrunn May 16, 2023
1474718
[UPD] Update scheduler_error_mailer.pot
Jun 8, 2023
cf7127b
[UPD] README.rst
OCA-git-bot Jun 8, 2023
e1860b1
Update translation files
weblate Jun 8, 2023
3488b5f
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 9, 2023
2b86e4b
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
d24de02
[UPD] README.rst
OCA-git-bot Sep 3, 2023
93ec159
Update translation files
weblate Oct 9, 2023
bf229d2
[IMP] scheduler_error_mailer: pre-commit auto fixes
cuongnmtm Dec 29, 2023
02d2381
[MIG] scheduler_error_mailer: Migration to 17.0
cuongnmtm Dec 29, 2023
eb68e3f
[UPD] Update scheduler_error_mailer.pot
Feb 2, 2024
a2a2ae5
[BOT] post-merge updates
OCA-git-bot Feb 2, 2024
4794665
Update translation files
weblate Feb 3, 2024
8f9e9df
Added translation using Weblate (Italian)
mymage Feb 6, 2024
d35847b
Translated using Weblate (Italian)
mymage Feb 6, 2024
6e8fac4
Translated using Weblate (Chinese (Simplified) (zh_CN))
xtanuiha Jun 16, 2024
939c0d9
[IMP] scheduler_error_mailer: pre-commit auto fixes
youelEl Feb 6, 2025
a454b9e
[MIG] scheduler_error_mailer: Migration to 18.0
youelEl Feb 7, 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 <[email protected]>
- David Beal <[email protected]>
- Alexis de Lattre <[email protected]>
- Sodexis <[email protected]>
- Achraf Mhadhbi <[email protected]>
- `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>
25 changes: 25 additions & 0 deletions scheduler_error_mailer/demo/ir_cron_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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>
<!-- don't limit the number of calls -->
<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
}
)
108 changes: 108 additions & 0 deletions scheduler_error_mailer/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * scheduler_error_mailer
#
# Translators:
# Niki Waibel <[email protected]>, 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 <[email protected]>, 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>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
Loading