diff --git a/galicea_environment_checkup/README.md b/galicea_environment_checkup/README.md new file mode 100644 index 0000000..131745f --- /dev/null +++ b/galicea_environment_checkup/README.md @@ -0,0 +1 @@ +[See add-on page on odoo.com](https://apps.odoo.com/apps/modules/10.0/galicea_environment_checkup/) diff --git a/galicea_environment_checkup/README.rst b/galicea_environment_checkup/README.rst deleted file mode 100644 index b82dd29..0000000 --- a/galicea_environment_checkup/README.rst +++ /dev/null @@ -1,88 +0,0 @@ -About -===== - -This add-on allows you to: - -- programmatically check software dependencies required by your add-on, as well as inform the Administrator as to how to meet them, -- add custom verification for Odoo instance set-up and inform the Administrator about any inconsistencies. - -Dependency checks -================= -.. image:: /galicea_environment_checkup/static/description/dependencies.png - -How-to ------- -Just add ``environment_checkup`` entry to ``__manifest__.py`` - -.. code:: - - { - ... - 'environment_checkup': { - 'dependencies': { - 'python': [ - { - 'name': 'Crypto', - 'version': '>=2.6.2', - 'install': "pip install 'PyCrypto>=2.6.1'" - }, - ], - 'external': [ - { - 'name': 'wkhtmltopdf', - 'install': "apt install wkhtmltopdf" - }, - { - 'name': 'git', - 'version': '^3.0.0', - 'install': "apt install git" - } - ], - 'internal': [ - { - 'name': 'web', - 'version': '~10.0.1.0' - } - ] - } - } - } - -Custom in-code checks -===================== -.. image:: /galicea_environment_checkup/static/description/custom.png - -How-to ------- - -1. Add the check - -``system_checks.py`` - -.. code:: - - # -*- coding: utf-8 -*- - - import cgi - from odoo.addons.galicea_environment_checkup import custom_check, CheckSuccess, CheckWarning, CheckFail - - @custom_check - def check_mail(env): - users_without_emails = env['res.users'].sudo().search([('email', '=', False)]) - - if users_without_emails: - raise CheckWarning( - 'Some users don\'t have their e-mails set up.', - details='See user {}.'.format(cgi.escape(users_without_emails[0].name)) - ) - - return CheckSuccess('All users have their e-mails set.') - -2. Make sure it's loaded - -``__init__.py`` - -.. code:: - - # -*- coding: utf-8 -*- - from . import system_checks diff --git a/galicea_environment_checkup/__manifest__.py b/galicea_environment_checkup/__manifest__.py index b8948db..2d82ce7 100644 --- a/galicea_environment_checkup/__manifest__.py +++ b/galicea_environment_checkup/__manifest__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- { - 'name': "Galicea Enviromnent Check-up", + 'name': "Galicea Environment Check-up", 'summary': """ Programmatically validate environment, including internal and external @@ -23,5 +23,10 @@ 'qweb': ['static/src/xml/templates.xml'], + 'images': [ + 'static/description/images/custom_screenshot.png', + 'static/description/images/dependencies_screenshot.png' + ], + 'installable': True } diff --git a/galicea_environment_checkup/static/description/icon.png b/galicea_environment_checkup/static/description/icon.png index 548dfc9..7b923bd 100644 Binary files a/galicea_environment_checkup/static/description/icon.png and b/galicea_environment_checkup/static/description/icon.png differ diff --git a/galicea_environment_checkup/static/description/custom.png b/galicea_environment_checkup/static/description/images/custom_screenshot.png similarity index 100% rename from galicea_environment_checkup/static/description/custom.png rename to galicea_environment_checkup/static/description/images/custom_screenshot.png diff --git a/galicea_environment_checkup/static/description/dependencies.png b/galicea_environment_checkup/static/description/images/dependencies_screenshot.png similarity index 100% rename from galicea_environment_checkup/static/description/dependencies.png rename to galicea_environment_checkup/static/description/images/dependencies_screenshot.png diff --git a/galicea_environment_checkup/static/description/index.html b/galicea_environment_checkup/static/description/index.html new file mode 100644 index 0000000..d592e8a --- /dev/null +++ b/galicea_environment_checkup/static/description/index.html @@ -0,0 +1,79 @@ +
+
+
+

Galicea Environment Check-up

+

+ Programmatically validate Odoo environment, including internal and external dependencies of your add-on +

+ This add-on allows you to: +
    +
  • programmatically check software dependencies required by your add-on, as well as inform the Administrator as to how to meet them,
  • +
  • add custom verification for Odoo instance set-up and inform the Administrator about any inconsistencies.
  • +
+

Add-on dependency verification

+ +

How-to

+ Just add 'environment_checkup' entry to __manifest__.py. +
+{
+    ...
+    'environment_checkup': {
+        'dependencies': {
+            'python': [
+                {
+                    'name': 'Crypto',
+                    'version': '>=2.6.2',
+                    'install': "pip install 'PyCrypto>=2.6.1'"
+                },
+            ],
+            'external': [
+                {
+                    'name': 'wkhtmltopdf',
+                    'install': "apt install wkhtmltopdf"
+                },
+                {
+                    'name': 'git',
+                    'version': '^3.0.0',
+                    'install': "apt install git"
+                }
+            ],
+            'internal': [
+                {
+                    'name': 'web',
+                    'version': '~10.0.1.0'
+                }
+            ]
+        }
+    }
+}
+        
+

Custom environment verification

+ +

How-to

+ 1. Add the check, e.g. in the system_checks.py file: +
+# -*- coding: utf-8 -*-
+
+import cgi
+from odoo.addons.galicea_environment_checkup import custom_check, CheckSuccess, CheckWarning, CheckFail
+
+@custom_check
+def check_mail(env):
+    users_without_emails = env['res.users'].sudo().search([('email', '=', False)])
+
+    if users_without_emails:
+        raise CheckWarning(
+            'Some users don\'t have their e-mails set up.',
+            details='See user {}.'.format(cgi.escape(users_without_emails[0].name))
+        )
+
+    return CheckSuccess('All users have their e-mails set.')
+        
+ 2. Make sure it's loaded by __init__.py +
+# -*- coding: utf-8 -*-
+from . import system_checks
+        
+
+
+