diff --git a/cron_run_manually/__init__.py b/cron_run_manually/__init__.py deleted file mode 100644 index e7a7313279b..00000000000 --- a/cron_run_manually/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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/__openerp__.py b/cron_run_manually/__openerp__.py deleted file mode 100644 index 014dc9f8d36..00000000000 --- a/cron_run_manually/__openerp__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- 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 . - -{ - 'name': 'Call cron jobs from their form view', - 'version': '8.0.1.0.0', - 'author': "Therp BV (OpenERP S.A.),Odoo Community Association (OCA)", - 'license': 'AGPL-3', - 'category': 'Tools', - 'description': """ -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', 'mail'], - 'data': ['view/ir_cron.xml'], - "test": [ - "tests/correct_uid.yml", - ], - 'installable': False, -} diff --git a/cron_run_manually/i18n/cron_run_manually.pot b/cron_run_manually/i18n/cron_run_manually.pot deleted file mode 100644 index 95b747f1ec5..00000000000 --- a/cron_run_manually/i18n/cron_run_manually.pot +++ /dev/null @@ -1,33 +0,0 @@ -# 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 09:47+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \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 "" - -#. 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 "" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "" diff --git a/cron_run_manually/i18n/en.po b/cron_run_manually/i18n/en.po deleted file mode 100644 index 30a3d0b6929..00000000000 --- a/cron_run_manually/i18n/en.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:54+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-server-tools-8-0/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, python-format -msgid "Another process/thread is already busy executing this job" -msgstr "Another process/thread is already busy executing this job" - -#. 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 "Only the admin user is allowed to execute inactive cron jobs manually" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view_tree_inherited -msgid "Run Now" -msgstr "Run Now" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Run now" diff --git a/cron_run_manually/i18n/es.po b/cron_run_manually/i18n/es.po deleted file mode 100644 index 55e6b8c99e4..00000000000 --- a/cron_run_manually/i18n/es.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:54+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, 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_tree_inherited -msgid "Run Now" -msgstr "" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Ejecutar ahora" diff --git a/cron_run_manually/i18n/fr.po b/cron_run_manually/i18n/fr.po deleted file mode 100644 index 191a4e5c7c4..00000000000 --- a/cron_run_manually/i18n/fr.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -# Pierre Verkest , 2015 -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-24 21:08+0000\n" -"Last-Translator: Pierre Verkest \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: fr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, python-format -msgid "Another process/thread is already busy executing this job" -msgstr "Cette tâche est déjà en cours par un autre processus" - -#. 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 "Seul l'administrateur est autorisé à exécuter manuellement des tâches planifiées inactives " - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view_tree_inherited -msgid "Run Now" -msgstr "Démarrer" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Démarrer" diff --git a/cron_run_manually/i18n/nl.po b/cron_run_manually/i18n/nl.po deleted file mode 100644 index 75b5275d469..00000000000 --- a/cron_run_manually/i18n/nl.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:54+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Dutch (http://www.transifex.com/oca/OCA-server-tools-8-0/language/nl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: nl\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, python-format -msgid "Another process/thread is already busy executing this job" -msgstr "Deze job wordt op dit moment al uitgevoerd door een ander proces" - -#. 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 "" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view_tree_inherited -msgid "Run Now" -msgstr "" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Nu uitvoeren" diff --git a/cron_run_manually/i18n/pt_BR.po b/cron_run_manually/i18n/pt_BR.po deleted file mode 100644 index 36f08f89b6a..00000000000 --- a/cron_run_manually/i18n/pt_BR.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -# Armando Vulcano Junior , 2015 -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 21:19+0000\n" -"Last-Translator: Armando Vulcano Junior \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, python-format -msgid "Another process/thread is already busy executing this job" -msgstr "Um outro processo já está ocupado executando este trabalho" - -#. 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 "Apenas o usuário administrador está autorizado a executar cron jobs inativos manualmente" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view_tree_inherited -msgid "Run Now" -msgstr "Executar Agora" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Executar agora" diff --git a/cron_run_manually/i18n/sl.po b/cron_run_manually/i18n/sl.po deleted file mode 100644 index 2197883f76e..00000000000 --- a/cron_run_manually/i18n/sl.po +++ /dev/null @@ -1,41 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * cron_run_manually -# -# Translators: -# Matjaž Mozetič , 2015 -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-26 07:44+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" - -#. module: cron_run_manually -#: code:addons/cron_run_manually/ir_cron.py:56 -#, python-format -msgid "Another process/thread is already busy executing this job" -msgstr "Pri izvajanju te naloge je zaposlen že drug proces" - -#. 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 "Le administrator lahko ročno izvaja 'cron jobs'" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view_tree_inherited -msgid "Run Now" -msgstr "Zaženi zdaj" - -#. module: cron_run_manually -#: view:ir.cron:cron_run_manually.ir_cron_view -msgid "Run now" -msgstr "Zaženi zdaj" diff --git a/cron_run_manually/ir_cron.py b/cron_run_manually/ir_cron.py deleted file mode 100644 index 91430af7f2b..00000000000 --- a/cron_run_manually/ir_cron.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- 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 . - -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__) - - -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')) - - 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) - - except OperationalError 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')) - - raise - - _logger.info('Job `%s` triggered from form', self.name) - - # Do not propagate active_test to the method to execute - ctx = dict(self.env.context) - ctx.pop('active_test', None) - - # Execute the cron job - method = getattr( - self.with_context(ctx).sudo(self.user_id).env[self.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/static/description/icon.png b/cron_run_manually/static/description/icon.png deleted file mode 100644 index 3a0328b516c..00000000000 Binary files a/cron_run_manually/static/description/icon.png and /dev/null differ diff --git a/cron_run_manually/tests/correct_uid.yml b/cron_run_manually/tests/correct_uid.yml deleted file mode 100644 index d63294125ba..00000000000 --- a/cron_run_manually/tests/correct_uid.yml +++ /dev/null @@ -1,23 +0,0 @@ -- 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 -- !python {model: ir.cron, id: check_uid_job}: | - assert self.run_manually()[0] == self.user_id.id, "Wrong UID in cron job" diff --git a/cron_run_manually/view/ir_cron.xml b/cron_run_manually/view/ir_cron.xml deleted file mode 100644 index 4a877561e35..00000000000 --- a/cron_run_manually/view/ir_cron.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ir.cron - - - -