Browse Source

[IMP] module_auto_update: UI button

pull/1505/head
Alexey Pelykh 5 years ago
parent
commit
fe746d57ca
  1. 6
      module_auto_update/README.rst
  2. 2
      module_auto_update/__init__.py
  3. 8
      module_auto_update/__manifest__.py
  4. 2
      module_auto_update/addon_hash.py
  5. 2
      module_auto_update/hooks.py
  6. 2
      module_auto_update/models/__init__.py
  7. 2
      module_auto_update/models/module.py
  8. 6
      module_auto_update/readme/USAGE.rst
  9. 5
      module_auto_update/static/description/index.html
  10. 2
      module_auto_update/tests/__init__.py
  11. 2
      module_auto_update/tests/test_addon_hash.py
  12. 2
      module_auto_update/tests/test_module.py
  13. 27
      module_auto_update/views/ir_module_module.xml

6
module_auto_update/README.rst

@ -63,7 +63,11 @@ the method ``_save_installed_checksums`` can be invoked in a situation
where one is sure all modules on disk are installed and up-to-date in the
database.
An easy way to invoke this upgrade mechanism is by issuing the following
To invoke the upgrade mechanism, navigate to *Apps* menu and use the
*Auto-Upgrade Modules* button, available only in developer mode. Restarting
the Odoo instance is highly recommended to minify risk of any possible issues.
Another easy way to invoke this upgrade mechanism is by issuing the following
in an Odoo shell session:
.. code-block:: python

2
module_auto_update/__init__.py

@ -1,4 +1,4 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from . import models
from .hooks import uninstall_hook

8
module_auto_update/__manifest__.py

@ -1,10 +1,11 @@
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Copyright 2018 Brainbean Apps (https://brainbeanapps.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
'name': 'Module Auto Update',
'summary': 'Automatically update Odoo modules',
'version': '12.0.2.0.4',
'version': '12.0.2.0.5',
'category': 'Extra Tools',
'website': 'https://github.com/OCA/server-tools',
'author': 'LasLabs, '
@ -18,6 +19,9 @@
'depends': [
'base',
],
'data': [
'views/ir_module_module.xml',
],
'development_status': 'Production/Stable',
'maintainers': ['sbidoul'],
}

2
module_auto_update/addon_hash.py

@ -1,5 +1,5 @@
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from fnmatch import fnmatch
import hashlib

2
module_auto_update/hooks.py

@ -1,5 +1,5 @@
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from odoo import SUPERUSER_ID, api

2
module_auto_update/models/__init__.py

@ -1,3 +1,3 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from . import module

2
module_auto_update/models/module.py

@ -1,6 +1,6 @@
# Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import json
import logging

6
module_auto_update/readme/USAGE.rst

@ -10,7 +10,11 @@ the method ``_save_installed_checksums`` can be invoked in a situation
where one is sure all modules on disk are installed and up-to-date in the
database.
An easy way to invoke this upgrade mechanism is by issuing the following
To invoke the upgrade mechanism, navigate to *Apps* menu and use the
*Auto-Upgrade Modules* button, available only in developer mode. Restarting
the Odoo instance is highly recommended to minify risk of any possible issues.
Another easy way to invoke this upgrade mechanism is by issuing the following
in an Odoo shell session:
.. code-block:: python

5
module_auto_update/static/description/index.html

@ -410,7 +410,10 @@ This is by design, priviledging safety. Should this be an issue,
the method <tt class="docutils literal">_save_installed_checksums</tt> can be invoked in a situation
where one is sure all modules on disk are installed and up-to-date in the
database.</p>
<p>An easy way to invoke this upgrade mechanism is by issuing the following
<p>To invoke the upgrade mechanism, navigate to <em>Apps</em> menu and use the
<em>Auto-Upgrade Modules</em> button, available only in developer mode. Restarting
the Odoo instance is highly recommended to minify risk of any possible issues.</p>
<p>Another easy way to invoke this upgrade mechanism is by issuing the following
in an Odoo shell session:</p>
<pre class="code python literal-block">
<span class="n">env</span><span class="p">[</span><span class="s1">'ir.module.module'</span><span class="p">]</span><span class="o">.</span><span class="n">upgrade_changed_checksum</span><span class="p">()</span>

2
module_auto_update/tests/__init__.py

@ -1,4 +1,4 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from . import test_addon_hash
from . import test_module

2
module_auto_update/tests/test_addon_hash.py

@ -1,5 +1,5 @@
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import os
import unittest

2
module_auto_update/tests/test_module.py

@ -1,6 +1,6 @@
# Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
import os
import tempfile

27
module_auto_update/views/ir_module_module.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--
Copyright 2018 Brainbean Apps (https://brainbeanapps.com)
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
-->
<record id="ir_module_module_upgrade_changed_checksum" model="ir.actions.server">
<field name="name">Auto-Upgrade Modules</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="base.model_ir_module_module"/>
<field name="state">code</field>
<field name="code">
action = model.upgrade_changed_checksum()
</field>
</record>
<menuitem
name="Auto-Upgrade Modules"
action="ir_module_module_upgrade_changed_checksum"
id="menu_ir_module_module_upgrade_changed_checksum"
groups="base.group_no_one"
parent="base.menu_management"
sequence="45"
icon="fa-exchange"/>
</odoo>
Loading…
Cancel
Save