From 3858fa1884d3618b1b891c661fdcf5a80c6cd4f6 Mon Sep 17 00:00:00 2001 From: Kev-Roche Date: Thu, 6 Jun 2024 16:12:10 +0200 Subject: [PATCH] MIG database_age_cron --- database_age_cron/README.rst | 69 +++ database_age_cron/__init__.py | 0 database_age_cron/__manifest__.py | 17 + database_age_cron/data/cron.xml | 16 + database_age_cron/readme/DESCRIPTION.rst | 4 + database_age_cron/readme/USAGE.rst | 7 + .../static/description/index.html | 419 ++++++++++++++++++ .../odoo/addons/database_age_cron | 1 + setup/database_age_cron/setup.py | 6 + 9 files changed, 539 insertions(+) create mode 100644 database_age_cron/README.rst create mode 100644 database_age_cron/__init__.py create mode 100644 database_age_cron/__manifest__.py create mode 100644 database_age_cron/data/cron.xml create mode 100644 database_age_cron/readme/DESCRIPTION.rst create mode 100644 database_age_cron/readme/USAGE.rst create mode 100644 database_age_cron/static/description/index.html create mode 120000 setup/database_age_cron/odoo/addons/database_age_cron create mode 100644 setup/database_age_cron/setup.py diff --git a/database_age_cron/README.rst b/database_age_cron/README.rst new file mode 100644 index 000000000..882b4e428 --- /dev/null +++ b/database_age_cron/README.rst @@ -0,0 +1,69 @@ +================= +Database Age Cron +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:13ab0febe972f77eb9af2cdb678d69c6648e34f3a8519c45acb04a816b4eb549 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-akretion%2Fak--odoo--incubator-lightgray.png?logo=github + :target: https://github.com/akretion/ak-odoo-incubator/tree/16.0/database_age_cron + :alt: akretion/ak-odoo-incubator + +|badge1| |badge2| |badge3| + +This module adds a simple cron that allows to know easily what is the age of the database + +You just have to check the `lastcall` date of the cron (via Odoo or via SQL) +to know when it ran for the last time. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To make it work, you will need to deactivate the cron once the database is not in production anymore. + +For instance with a script that runs: + +.. code:: sql + + UPDATE ir_cron SET active='f' WHERE cron_name = 'Database Age Cron'; + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Maintainers +~~~~~~~~~~~ + +This module is part of the `akretion/ak-odoo-incubator `_ project on GitHub. + +You are welcome to contribute. diff --git a/database_age_cron/__init__.py b/database_age_cron/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/database_age_cron/__manifest__.py b/database_age_cron/__manifest__.py new file mode 100644 index 000000000..46113aaf3 --- /dev/null +++ b/database_age_cron/__manifest__.py @@ -0,0 +1,17 @@ +{ + "name": "Database Age Cron", + "summary": "Run a cron that determines database age", + "version": "16.0.1.0.0", + "category": "Uncategorized", + "website": "https://github.com/akretion/ak-odoo-incubator", + "author": " Akretion", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "base", + ], + "data": [ + "data/cron.xml", + ], +} diff --git a/database_age_cron/data/cron.xml b/database_age_cron/data/cron.xml new file mode 100644 index 000000000..5d2a556a0 --- /dev/null +++ b/database_age_cron/data/cron.xml @@ -0,0 +1,16 @@ + + + + + Database Age Cron + 1 + minutes + -1 + 10 + True + code + + pass + + + diff --git a/database_age_cron/readme/DESCRIPTION.rst b/database_age_cron/readme/DESCRIPTION.rst new file mode 100644 index 000000000..bb8b2ffbb --- /dev/null +++ b/database_age_cron/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module adds a simple cron that allows to know easily what is the age of the database + +You just have to check the `lastcall` date of the cron (via Odoo or via SQL) +to know when it ran for the last time. diff --git a/database_age_cron/readme/USAGE.rst b/database_age_cron/readme/USAGE.rst new file mode 100644 index 000000000..570602ee1 --- /dev/null +++ b/database_age_cron/readme/USAGE.rst @@ -0,0 +1,7 @@ +To make it work, you will need to deactivate the cron once the database is not in production anymore. + +For instance with a script that runs: + +.. code:: sql + + UPDATE ir_cron SET active='f' WHERE cron_name = 'Database Age Cron'; diff --git a/database_age_cron/static/description/index.html b/database_age_cron/static/description/index.html new file mode 100644 index 000000000..f197e8073 --- /dev/null +++ b/database_age_cron/static/description/index.html @@ -0,0 +1,419 @@ + + + + + +Database Age Cron + + + +
+

Database Age Cron

+ + +

Beta License: AGPL-3 akretion/ak-odoo-incubator

+

This module adds a simple cron that allows to know easily what is the age of the database

+

You just have to check the lastcall date of the cron (via Odoo or via SQL) +to know when it ran for the last time.

+

Table of contents

+ +
+

Usage

+

To make it work, you will need to deactivate the cron once the database is not in production anymore.

+

For instance with a script that runs:

+
+UPDATE ir_cron SET active='f' WHERE cron_name = 'Database Age Cron';
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Maintainers

+

This module is part of the akretion/ak-odoo-incubator project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/database_age_cron/odoo/addons/database_age_cron b/setup/database_age_cron/odoo/addons/database_age_cron new file mode 120000 index 000000000..36bd7ec76 --- /dev/null +++ b/setup/database_age_cron/odoo/addons/database_age_cron @@ -0,0 +1 @@ +../../../../database_age_cron \ No newline at end of file diff --git a/setup/database_age_cron/setup.py b/setup/database_age_cron/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/database_age_cron/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)