From 99d3a4a0c01dcf042e3af00c79deb6a20e4e674b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 11:34:19 +0200 Subject: [PATCH 01/12] Remove cron_run_manually from unported modules --- {__unported__/cron_run_manually => cron_run_manually}/__init__.py | 0 .../cron_run_manually => cron_run_manually}/__openerp__.py | 0 .../i18n/cron_run_manually.pot | 0 {__unported__/cron_run_manually => cron_run_manually}/i18n/nl.po | 0 .../cron_run_manually => cron_run_manually}/model/__init__.py | 0 .../cron_run_manually => cron_run_manually}/model/ir_cron.py | 0 .../cron_run_manually => cron_run_manually}/view/ir_cron.xml | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename {__unported__/cron_run_manually => cron_run_manually}/__init__.py (100%) rename {__unported__/cron_run_manually => cron_run_manually}/__openerp__.py (100%) rename {__unported__/cron_run_manually => cron_run_manually}/i18n/cron_run_manually.pot (100%) rename {__unported__/cron_run_manually => cron_run_manually}/i18n/nl.po (100%) rename {__unported__/cron_run_manually => cron_run_manually}/model/__init__.py (100%) rename {__unported__/cron_run_manually => cron_run_manually}/model/ir_cron.py (100%) rename {__unported__/cron_run_manually => cron_run_manually}/view/ir_cron.xml (100%) diff --git a/__unported__/cron_run_manually/__init__.py b/cron_run_manually/__init__.py similarity index 100% rename from __unported__/cron_run_manually/__init__.py rename to cron_run_manually/__init__.py diff --git a/__unported__/cron_run_manually/__openerp__.py b/cron_run_manually/__openerp__.py similarity index 100% rename from __unported__/cron_run_manually/__openerp__.py rename to cron_run_manually/__openerp__.py diff --git a/__unported__/cron_run_manually/i18n/cron_run_manually.pot b/cron_run_manually/i18n/cron_run_manually.pot similarity index 100% rename from __unported__/cron_run_manually/i18n/cron_run_manually.pot rename to cron_run_manually/i18n/cron_run_manually.pot diff --git a/__unported__/cron_run_manually/i18n/nl.po b/cron_run_manually/i18n/nl.po similarity index 100% rename from __unported__/cron_run_manually/i18n/nl.po rename to cron_run_manually/i18n/nl.po diff --git a/__unported__/cron_run_manually/model/__init__.py b/cron_run_manually/model/__init__.py similarity index 100% rename from __unported__/cron_run_manually/model/__init__.py rename to cron_run_manually/model/__init__.py diff --git a/__unported__/cron_run_manually/model/ir_cron.py b/cron_run_manually/model/ir_cron.py similarity index 100% rename from __unported__/cron_run_manually/model/ir_cron.py rename to cron_run_manually/model/ir_cron.py diff --git a/__unported__/cron_run_manually/view/ir_cron.xml b/cron_run_manually/view/ir_cron.xml similarity index 100% rename from __unported__/cron_run_manually/view/ir_cron.xml rename to cron_run_manually/view/ir_cron.xml From ea6e3f58d8819c6d03f07625adee6fea63edad0b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 11:39:15 +0200 Subject: [PATCH 02/12] Move model to root of addon directory --- cron_run_manually/__init__.py | 21 ++++++++++++++++++++- cron_run_manually/{model => }/ir_cron.py | 0 cron_run_manually/model/__init__.py | 1 - 3 files changed, 20 insertions(+), 2 deletions(-) rename cron_run_manually/{model => }/ir_cron.py (100%) delete mode 100644 cron_run_manually/model/__init__.py diff --git a/cron_run_manually/__init__.py b/cron_run_manually/__init__.py index 16e8b082f..e7a731327 100644 --- a/cron_run_manually/__init__.py +++ b/cron_run_manually/__init__.py @@ -1 +1,20 @@ -import model +# -*- coding: utf-8 -*- + +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV () +# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A. +# +# 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 . + +from . import ir_cron diff --git a/cron_run_manually/model/ir_cron.py b/cron_run_manually/ir_cron.py similarity index 100% rename from cron_run_manually/model/ir_cron.py rename to cron_run_manually/ir_cron.py diff --git a/cron_run_manually/model/__init__.py b/cron_run_manually/model/__init__.py deleted file mode 100644 index 452b62ec4..000000000 --- a/cron_run_manually/model/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import ir_cron From 58756416c1fdd96074f48026207116cc996225c6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 11:39:56 +0200 Subject: [PATCH 03/12] Odoo v8.0 compatibility --- cron_run_manually/__openerp__.py | 39 +++++----- cron_run_manually/ir_cron.py | 127 +++++++++++++++---------------- 2 files changed, 79 insertions(+), 87 deletions(-) diff --git a/cron_run_manually/__openerp__.py b/cron_run_manually/__openerp__.py index bc6da1037..d20812cb1 100644 --- a/cron_run_manually/__openerp__.py +++ b/cron_run_manually/__openerp__.py @@ -1,29 +1,26 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2013 Therp BV () -# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A. -# -# 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. + +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV () +# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A. # -# 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. +# 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. # -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# 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 . { 'name': 'Call cron jobs from their form view', - 'version': '0.1', - 'author': ["Therp BV", "OpenERP S.A."], + 'version': '1.0', + 'author': "Therp BV (OpenERP S.A.)", 'license': 'AGPL-3', 'category': 'Tools', 'description': """ @@ -33,5 +30,5 @@ of the scheduler. """, 'depends': ['base'], 'data': ['view/ir_cron.xml'], - 'installable': False, - } + 'installable': True, +} diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index 3d7a30fa3..7ebb894e2 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -1,82 +1,77 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2013 Therp BV () -# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A. -# -# 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. + +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV () +# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A. # -# 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. +# 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. # -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# 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 . -import psycopg2 import logging -from openerp.osv import orm -from openerp.tools import SUPERUSER_ID -from openerp.tools.translate import _ +from openerp import _, api, exceptions, models, SUPERUSER_ID from openerp.tools.safe_eval import safe_eval -class irCron(orm.Model): - _inherit = 'ir.cron' +_logger = logging.getLogger(__name__) + + +class Cron(models.Model): + _name = _inherit = "ir.cron" + + @api.one + def run_manually(self): + """Run a job from the cron form view.""" + + if self.env.uid != SUPERUSER_ID and (not self.active or + not self.numbercall): + raise exceptions.AccessError( + _('Only the admin user is allowed to ' + 'execute inactive cron jobs manually')) - def run_manually(self, cr, uid, ids, context=None): - """ - Run a job from the cron form view. + _logger.warn(self.__dict__) + try: + # Try to grab an exclusive lock on the job row + # until the end of the transaction + self.env.cr.execute( + """SELECT * + FROM ir_cron + WHERE id=%s + FOR UPDATE NOWAIT""", + (self.id,), + log_exceptions=False) - Cut and paste of code snippets from addons/base/ir/ir_cron.py - """ - logger = logging.getLogger('cron_run_manually') - cr.execute( - """ - SELECT * from ir_cron - WHERE id in %s - """, (tuple(ids),)) - jobs = cr.dictfetchall() + except Exception as e: + # User friendly error if the lock could not be claimed + if getattr(e, "pgcode", None) == '55P03': + raise exceptions.Warning( + _('Another process/thread is already busy ' + 'executing this job')) - for job in jobs: - if uid != SUPERUSER_ID and ( - not job['active'] or not job['numbercall']): - raise orm.except_orm( - _('Error'), - _('Only the admin user is allowed to ' - 'execute inactive cron jobs manually')) + raise - try: - # Try to grab an exclusive lock on the job row - # until the end of the transaction - cr.execute( - """SELECT * - FROM ir_cron - WHERE id=%s - FOR UPDATE NOWAIT""", - (job['id'],), log_exceptions=False) + _logger.info('Job `%s` triggered from form', self.name) - # Got the lock on the job row, run its code - logger.debug('Job `%s` triggered from form', job['name']) - model = self.pool.get(job['model']) - method = getattr(model, job['function']) - args = safe_eval('tuple(%s)' % (job['args'] or '')) - method(cr, job['user_id'], *args) + # Prepare execution + method = getattr(self.env[self.model], self.function) + args = safe_eval('tuple(%s)' % (self.args or '')) - except psycopg2.OperationalError as e: - # User friendly error if the lock could not be claimed - if e.pgcode == '55P03': - raise orm.except_orm( - _('Error'), - _('Another process/thread is already busy ' - 'executing this job')) - raise + # Hack the UID + old_uid = self.env.uid + self.env.uid = self.user_id - return True + # Execute the cron job + try: + method(*args) + finally: + # Revert UID to original + self.env.uid = old_uid From 090d5978822ac236c920ff00a3bc9f7e578404e3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 11:48:50 +0200 Subject: [PATCH 04/12] Update translate template. --- cron_run_manually/i18n/cron_run_manually.pot | 30 ++++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/cron_run_manually/i18n/cron_run_manually.pot b/cron_run_manually/i18n/cron_run_manually.pot index 5324df8da..95b747f1e 100644 --- a/cron_run_manually/i18n/cron_run_manually.pot +++ b/cron_run_manually/i18n/cron_run_manually.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * cron_run_manually # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0rc1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-14 17:41+0000\n" -"PO-Revision-Date: 2014-03-14 17:41+0000\n" +"POT-Creation-Date: 2014-09-16 09:47+0000\n" +"PO-Revision-Date: 2014-09-16 09:47+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,32 +16,18 @@ msgstr "" "Plural-Forms: \n" #. module: cron_run_manually -#: code:addons/cron_run_manually/model/ir_cron.py:77 +#: code:addons/cron_run_manually/ir_cron.py:57 #, python-format msgid "Another process/thread is already busy executing this job" msgstr "" #. module: cron_run_manually -#: view:ir.cron:0 -msgid "Run now" -msgstr "" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/model/ir_cron.py:52 +#: code:addons/cron_run_manually/ir_cron.py:38 #, python-format msgid "Only the admin user is allowed to execute inactive cron jobs manually" msgstr "" #. module: cron_run_manually -#: model:_description:0 -#: model:ir.model,name:cron_run_manually.model_ir_cron -msgid "ir.cron" -msgstr "" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/model/ir_cron.py:51 -#: code:addons/cron_run_manually/model/ir_cron.py:76 -#, python-format -msgid "Error" +#: view:ir.cron:cron_run_manually.ir_cron_view +msgid "Run now" msgstr "" - From 872da121f6da8add86a725130c2c845b20879b2f Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 11:53:24 +0200 Subject: [PATCH 05/12] Add Spanish translation. --- cron_run_manually/i18n/es.po | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cron_run_manually/i18n/es.po diff --git a/cron_run_manually/i18n/es.po b/cron_run_manually/i18n/es.po new file mode 100644 index 000000000..6d74ae23c --- /dev/null +++ b/cron_run_manually/i18n/es.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * cron_run_manually +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0rc1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-09-16 09:47+0000\n" +"PO-Revision-Date: 2014-09-16 11:52+0100\n" +"Last-Translator: Jairo Llopis \n" +"Language-Team: Grupo ESOC \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"Language: es\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#. module: cron_run_manually +#: code:addons/cron_run_manually/ir_cron.py:57 +#, python-format +msgid "Another process/thread is already busy executing this job" +msgstr "Hay otro proceso o hilo ejecutando este trabajo en este momento" + +#. module: cron_run_manually +#: code:addons/cron_run_manually/ir_cron.py:38 +#, python-format +msgid "Only the admin user is allowed to execute inactive cron jobs manually" +msgstr "" +"Solo el administrador puede ejecutar manualmente trabajos cron inactivos" + +#. module: cron_run_manually +#: view:ir.cron:cron_run_manually.ir_cron_view +msgid "Run now" +msgstr "Ejecutar ahora" From 42828e938235dae5a0c09cfc47c1a7cd859f05b4 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 12:55:22 +0200 Subject: [PATCH 06/12] Fix permissions issue. --- cron_run_manually/ir_cron.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index 7ebb894e2..3a00f3cc5 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -61,17 +61,8 @@ class Cron(models.Model): _logger.info('Job `%s` triggered from form', self.name) - # Prepare execution - method = getattr(self.env[self.model], self.function) - args = safe_eval('tuple(%s)' % (self.args or '')) - - # Hack the UID - old_uid = self.env.uid - self.env.uid = self.user_id - # Execute the cron job - try: - method(*args) - finally: - # Revert UID to original - self.env.uid = old_uid + method = getattr(self.sudo(self.user_id).env[self.model], + self.function) + args = safe_eval('tuple(%s)' % (self.args or '')) + method(*args) From 1d172b46780095ad970eefd4f1de58679a0c260c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Sep 2014 13:44:28 +0200 Subject: [PATCH 07/12] Clean debug garbage. --- cron_run_manually/ir_cron.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index 3a00f3cc5..bba3dbd3a 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -38,7 +38,6 @@ class Cron(models.Model): _('Only the admin user is allowed to ' 'execute inactive cron jobs manually')) - _logger.warn(self.__dict__) try: # Try to grab an exclusive lock on the job row # until the end of the transaction From 400e245c96e8d8297c63e88110474bb6a2765548 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 18 Sep 2014 10:24:11 +0200 Subject: [PATCH 08/12] Return the method's result. --- cron_run_manually/ir_cron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index bba3dbd3a..31ad714e3 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -64,4 +64,4 @@ class Cron(models.Model): method = getattr(self.sudo(self.user_id).env[self.model], self.function) args = safe_eval('tuple(%s)' % (self.args or '')) - method(*args) + return method(*args) From e7e0690fab516e32a34f98194b1d2d0eb04dd69e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 18 Sep 2014 12:36:42 +0200 Subject: [PATCH 09/12] Add test to check the job runs with the right UID. Test fails, BTW. --HG-- extra : amend_source : 9387347e10a5f3e48188f87ab87006523275f379 --- cron_run_manually/__openerp__.py | 3 +++ cron_run_manually/ir_cron.py | 6 ++++++ cron_run_manually/tests/correct_uid.yml | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 cron_run_manually/tests/correct_uid.yml diff --git a/cron_run_manually/__openerp__.py b/cron_run_manually/__openerp__.py index d20812cb1..4e92e72ed 100644 --- a/cron_run_manually/__openerp__.py +++ b/cron_run_manually/__openerp__.py @@ -30,5 +30,8 @@ of the scheduler. """, 'depends': ['base'], 'data': ['view/ir_cron.xml'], + "test": [ + "tests/correct_uid.yml", + ], 'installable': True, } diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index 31ad714e3..7b5ba8133 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -65,3 +65,9 @@ class Cron(models.Model): self.function) args = safe_eval('tuple(%s)' % (self.args or '')) return method(*args) + + @api.model + def _current_uid(self): + """This function returns the current UID, for testing purposes.""" + + return self.env.uid diff --git a/cron_run_manually/tests/correct_uid.yml b/cron_run_manually/tests/correct_uid.yml new file mode 100644 index 000000000..34af0c227 --- /dev/null +++ b/cron_run_manually/tests/correct_uid.yml @@ -0,0 +1,23 @@ +- I create a user that will run the job. +- !record {model: res.users, id: worker_user, view: False}: + company_id: base.main_company + name: worker + login: worker + password: worker + email: worker@example.com + +- Create a cron job to check the UID +- !record {model: ir.cron, id: check_uid_job}: + name: Check UID + active: True + user_id: worker_user + interval_number: 1 + interval_type: days + numbercall: -1 + doall: False + model: ir.cron + function: _current_uid + +- I execute the cron job manually to check its running UID +- !assert {model: ir.cron, id: check_uid_job}: | + self.run_manually()[0] == self.user_id From 5aeeb809151a6e98ef52522aef48acaa57af0502 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 19 Sep 2014 12:15:59 +0200 Subject: [PATCH 10/12] Fix assertion. --HG-- extra : amend_source : 6d240dcaf7da6ecb618e6285c823fcc0387201d3 --- cron_run_manually/tests/correct_uid.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron_run_manually/tests/correct_uid.yml b/cron_run_manually/tests/correct_uid.yml index 34af0c227..d63294125 100644 --- a/cron_run_manually/tests/correct_uid.yml +++ b/cron_run_manually/tests/correct_uid.yml @@ -19,5 +19,5 @@ function: _current_uid - I execute the cron job manually to check its running UID -- !assert {model: ir.cron, id: check_uid_job}: | - self.run_manually()[0] == self.user_id +- !python {model: ir.cron, id: check_uid_job}: | + assert self.run_manually()[0] == self.user_id.id, "Wrong UID in cron job" From c0167896ff0acf2e8b5cc334bd851fe64f673ef5 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 28 Nov 2014 09:57:44 +0100 Subject: [PATCH 11/12] More concrete exception. --- cron_run_manually/ir_cron.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py index 7b5ba8133..7dc7eea6c 100644 --- a/cron_run_manually/ir_cron.py +++ b/cron_run_manually/ir_cron.py @@ -20,7 +20,7 @@ import logging from openerp import _, api, exceptions, models, SUPERUSER_ID from openerp.tools.safe_eval import safe_eval - +from psycopg2 import OperationalError _logger = logging.getLogger(__name__) @@ -49,7 +49,7 @@ class Cron(models.Model): (self.id,), log_exceptions=False) - except Exception as e: + except OperationalError as e: # User friendly error if the lock could not be claimed if getattr(e, "pgcode", None) == '55P03': raise exceptions.Warning( From 693b05a189bd8333a3c3a7c5731c3ce23821d119 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 9 Dec 2014 18:21:18 +0100 Subject: [PATCH 12/12] Compatibilize test with Travis. See https://github.com/OCA/server-tools/pull/81#issuecomment-66042648 --- cron_run_manually/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron_run_manually/__openerp__.py b/cron_run_manually/__openerp__.py index 4e92e72ed..87186c96c 100644 --- a/cron_run_manually/__openerp__.py +++ b/cron_run_manually/__openerp__.py @@ -28,7 +28,7 @@ This module adds a button to the cron scheduled task form in OpenERP that allows the administrator to run the job immediately, independently of the scheduler. """, - 'depends': ['base'], + 'depends': ['base', 'mail'], 'data': ['view/ir_cron.xml'], "test": [ "tests/correct_uid.yml",