From 99ef6fdd3bb906b217f3a89cdf4d485cda82ccf3 Mon Sep 17 00:00:00 2001 From: Achref Mhadhbi Date: Thu, 21 Jun 2018 12:15:53 +0200 Subject: [PATCH] [MIG] scheduler_error_mailer: Migration to 11.0 --- scheduler_error_mailer/README.rst | 3 ++- scheduler_error_mailer/__manifest__.py | 2 +- scheduler_error_mailer/demo/ir_cron_demo.xml | 6 ++++-- scheduler_error_mailer/models/__init__.py | 2 +- scheduler_error_mailer/models/ir_cron.py | 18 +++++++++--------- scheduler_error_mailer/views/ir_cron.xml | 3 ++- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/scheduler_error_mailer/README.rst b/scheduler_error_mailer/README.rst index 9ba801de4..db7417404 100644 --- a/scheduler_error_mailer/README.rst +++ b/scheduler_error_mailer/README.rst @@ -24,7 +24,7 @@ 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/10.0 + :target: https://runbot.odoo-community.org/runbot/149/11.0 Bug Tracker =========== @@ -49,6 +49,7 @@ Contributors * David Beal * Alexis de Lattre * Sodexis +* Achraf Mhadhbi Maintainer diff --git a/scheduler_error_mailer/__manifest__.py b/scheduler_error_mailer/__manifest__.py index 0da065b2b..5c10761f2 100644 --- a/scheduler_error_mailer/__manifest__.py +++ b/scheduler_error_mailer/__manifest__.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre # © 2016 Sodexis +# © 2018 bloopark systems () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { diff --git a/scheduler_error_mailer/demo/ir_cron_demo.xml b/scheduler_error_mailer/demo/ir_cron_demo.xml index 08368e8e7..80e3c88cb 100644 --- a/scheduler_error_mailer/demo/ir_cron_demo.xml +++ b/scheduler_error_mailer/demo/ir_cron_demo.xml @@ -3,6 +3,7 @@ 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 () The licence is in the file __openerp__.py --> @@ -18,8 +19,9 @@ -1 - ir.cron - _test_scheduler_failure + + code + model._test_scheduler_failure() diff --git a/scheduler_error_mailer/models/__init__.py b/scheduler_error_mailer/models/__init__.py index 91c8e5e18..151e123d9 100644 --- a/scheduler_error_mailer/models/__init__.py +++ b/scheduler_error_mailer/models/__init__.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre # © 2016 Sodexis +# © 2018 bloopark systems () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ir_cron diff --git a/scheduler_error_mailer/models/ir_cron.py b/scheduler_error_mailer/models/ir_cron.py index efb2a4bed..9eedcfa23 100644 --- a/scheduler_error_mailer/models/ir_cron.py +++ b/scheduler_error_mailer/models/ir_cron.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- # © 2012-2013 Akretion Sébastien BEAU,David Beal,Alexis de Lattre # © 2016 Sodexis +# © 2018 bloopark systems () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ +from odoo import _, api, fields, models from odoo.exceptions import UserError import logging @@ -22,11 +22,12 @@ class IrCron(models.Model): ) @api.model - def _handle_callback_exception( - self, model_name, method_name, args, job_id, job_exception): - res = super(IrCron, self)._handle_callback_exception( - model_name, method_name, args, job_id, job_exception) - + def _handle_callback_exception(self, cron_name, server_action_id, job_id, + job_exception): + res = super(IrCron, self)._handle_callback_exception(cron_name, + server_action_id, + job_id, + job_exception) my_cron = self.browse(job_id) if my_cron.email_template_id: @@ -49,7 +50,6 @@ class IrCron(models.Model): @api.model def _test_scheduler_failure(self): - """This function is used to test and debug this module""" - + """This function is used to test and debug this module.""" raise UserError( _("Task failure with UID = %d.") % self._uid) diff --git a/scheduler_error_mailer/views/ir_cron.xml b/scheduler_error_mailer/views/ir_cron.xml index 3ade1e1b8..a6ee1f9da 100644 --- a/scheduler_error_mailer/views/ir_cron.xml +++ b/scheduler_error_mailer/views/ir_cron.xml @@ -3,6 +3,7 @@ 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 () The licence is in the file __openerp__.py --> @@ -11,7 +12,7 @@ ir.cron.error.mailer.form ir.cron - +