Commit Graph

57 Commits (f52867b47b50728a13b2ab44bceedb14a400d91d)

Author SHA1 Message Date
Miku Laitinen ae00f76f38 [MIG] module_auto_update: Migration to 15.0 2021-12-27 17:39:03 +02:00
Francesco Foresti 115c83ba87 Translated using Weblate (Italian)
Currently translated at 100.0% (6 of 6 strings)

Translation: server-tools-14.0/server-tools-14.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-module_auto_update/it/
2021-12-27 16:49:36 +02:00
Yves Le Doeuff a8eebfb062 Translated using Weblate (French)
Currently translated at 66.6% (4 of 6 strings)

Translation: server-tools-14.0/server-tools-14.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-module_auto_update/fr/
2021-12-27 16:49:36 +02:00
OCA Transbot 473c74af11 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-14.0/server-tools-14.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-module_auto_update/
2021-12-27 16:49:36 +02:00
oca-travis 7d6df62eab [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
OCA-git-bot 86cced3486 module_auto_update 14.0.1.0.1 2021-12-27 16:49:36 +02:00
OCA-git-bot 0e6f2b935b [UPD] README.rst 2021-12-27 16:49:36 +02:00
oca-travis 24b12f6fce [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
Manuel Engel 1b1a750a6c [MIG] module_auto_update: Migration to 14.0 2021-12-27 16:49:36 +02:00
Manuel Engel 50c555da1b [MIG] module_auto_update: Migration to 14.0 2021-12-27 16:49:36 +02:00
Manuel Engel 5106bcf5d7 [MIG] module_auto_update: Migration to 14.0 2021-12-27 16:49:36 +02:00
oca-travis 620935e7a1 [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
Eric Antones 30a9d259d0 [MIG] module_auto_update: Migration to 13.0 2021-12-27 16:49:36 +02:00
Eric Antones e5f4fd42f0 [IMP] module_auto_update: black, isort, prettier 2021-12-27 16:49:36 +02:00
黎伟杰 127422022c Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (2 of 2 strings)

Translation: server-tools-12.0/server-tools-12.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-module_auto_update/zh_CN/
2021-12-27 16:49:36 +02:00
黎伟杰 35b319e030 Added translation using Weblate (Chinese (Simplified)) 2021-12-27 16:49:36 +02:00
Rodrigo Macedo 46f2b058e8 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (2 of 2 strings)

Translation: server-tools-12.0/server-tools-12.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-module_auto_update/pt_BR/
2021-12-27 16:49:36 +02:00
OCA-git-bot 7a955b5d59 [UPD] README.rst 2021-12-27 16:49:36 +02:00
mreficent b41e23d1c3 [FIX] Add migration scripts to v12 2021-12-27 16:49:36 +02:00
OCA-git-bot f242978b7b [ADD] icon.png 2021-12-27 16:49:36 +02:00
OCA Transbot a0cc4c29b9 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-12.0/server-tools-12.0-module_auto_update
Translate-URL: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-module_auto_update/
2021-12-27 16:49:36 +02:00
oca-travis 1021f7bd76 [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
OCA-git-bot 2798d0b1fb [UPD] README.rst 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 2040a2d32d module_auto_update: remove maintainer 2021-12-27 16:49:36 +02:00
Alexey Pelykh da5d5d892d [IMP] module_auto_update: UI button 2021-12-27 16:49:36 +02:00
OCA Transbot 0122b4e002 Update translation files
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
2021-12-27 16:49:36 +02:00
oca-travis be511349e8 [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
OCA-git-bot 221313a14d [UPD] README.rst 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 9c0fe371c7 module_auto_update: cosmetics 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 4fe1c0a110 [MIG] module_auto_update from 11 to 12
Use tagged to mark post install tests as previous mechanism
seems to be broken.
2021-12-27 16:49:36 +02:00
Simone Orsi f4588878da Global pylint cleanup 2021-12-27 16:49:36 +02:00
OCA Git Bot 04dce0df10 [UPD] README.rst 2021-12-27 16:49:36 +02:00
OCA Git Bot 7a0a496164 [UPD] README.rst 2021-12-27 16:49:36 +02:00
oca-travis 9395c665a2 [UPD] Update module_auto_update.pot 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 4cc73f43db module_auto_update: 11.0.2.0.4 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) e13e20bbd7 [UPD] README.rst 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) ba9479dd35 module_auto_update: readme fragments 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) d010cc579e module_auto_update: sbidoul as maintainer
Plus Stable development status
2021-12-27 16:49:36 +02:00
Denis Roussel c25aede879 [10.0][FIX] module_auto_update: Don't set 'to upgrade' on void recordset modules 2021-12-27 16:49:36 +02:00
Jairo Llopis 2c034991c1 [FIX] module_auto_update: Ignore `__pycache__` in hash test
Python >= 3.2 implements [PEP 3147](https://www.python.org/dev/peps/pep-3147/), so in a precompiled environment, the patched test could fail with this or similar:

    FAIL: test_basic (odoo.addons.module_auto_update.tests.test_addon_hash.TestAddonHash)
    Traceback (most recent call last):
    `   File "/opt/odoo/auto/addons/module_auto_update/tests/test_addon_hash.py", line 42, in test_basic
    `     'static/src/some.js',
    ` AssertionError: Lists differ: ['REA[237 chars]o', 'models/__pycache__/stuff.cpython-35.opt-1[23 chars].js'] != ['REA[237 chars]o', 'static/src/some.js']
    `
    ` First differing element 14:
    ` 'models/__pycache__/stuff.cpython-35.opt-1.pyc'
    ` 'static/src/some.js'
    `
    ` First list contains 1 additional elements.
    ` First extra element 15:
    ` 'static/src/some.js'
    `
    `   ['README.rst',
    `    'data/f1.xml',
    `    'data/f2.xml',
    `    'i18n/en.po',
    `    'i18n/en_US.po',
    `    'i18n/fr.po',
    `    'i18n/fr_BE.po',
    `    'i18n/test.pot',
    `    'i18n_extra/en.po',
    `    'i18n_extra/fr.po',
    `    'i18n_extra/nl_NL.po',
    `    'models/stuff.py',
    `    'models/stuff.pyc',
    `    'models/stuff.pyo',
    ` -  'models/__pycache__/stuff.cpython-35.opt-1.pyc',
    `    'static/src/some.js']

With this patch, we fix all those failing tests in integration environments.
2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 483d52b080 module_auto_update: bump version 2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) 2980351947 module_auto_update: check a post condition 2021-12-27 16:49:36 +02:00
Benjamin Willig 07d7f01f9f [CHG] updated version number 2021-12-27 16:49:36 +02:00
Jairo Llopis 386633d339 [FIX] module_auto_update: Rollback cursor if param exists
Without this patch, when upgrading after you have stored the deprecated features parameter, the cursor became broken and no more migrations could happen. You got this error:

    Traceback (most recent call last):
    File "/usr/local/bin/odoo", line 6, in <module>
        exec(compile(open(__file__).read(), __file__, 'exec'))
    File "/opt/odoo/custom/src/odoo/odoo.py", line 160, in <module>
        main()
    File "/opt/odoo/custom/src/odoo/odoo.py", line 157, in main
        openerp.cli.main()
    File "/opt/odoo/custom/src/odoo/openerp/cli/command.py", line 64, in main
        o.run(args)
    File "/opt/odoo/custom/src/odoo/openerp/cli/shell.py", line 65, in run
        self.shell(openerp.tools.config['db_name'])
    File "/opt/odoo/custom/src/odoo/openerp/cli/shell.py", line 52, in shell
        registry = openerp.modules.registry.RegistryManager.get(dbname)
    File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 355, in get
        update_module)
    File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 386, in new
        openerp.modules.load_modules(registry._db, force_demo, status, update_module)
    File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 335, in load_modules
        force, status, report, loaded_modules, update_module)
    File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 239, in load_marked_modules
        loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
    File "/opt/odoo/custom/src/odoo/openerp/modules/loading.py", line 136, in load_module_graph
        registry.setup_models(cr, partial=True)
    File "/opt/odoo/custom/src/odoo/openerp/modules/registry.py", line 186, in setup_models
        cr.execute('select model, transient from ir_model where state=%s', ('manual',))
    File "/opt/odoo/custom/src/odoo/openerp/sql_db.py", line 154, in wrapper
        return f(self, *args, **kwargs)
    File "/opt/odoo/custom/src/odoo/openerp/sql_db.py", line 233, in execute
        res = self._obj.execute(query, params)
    psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block

Now you can safely migrate, be that parameter pre-created or not.
2021-12-27 16:49:36 +02:00
Laurent Mignon (ACSONE) 0c1395a3d8 [FIX] Forward port module_auto_update refactoring from 9.0 2021-12-27 16:49:36 +02:00
Jairo Llopis d93d9c90bc [FIX] module_auto_update: Add .pyo sample file (#1205)
Without this patch, if your tests are run under a `PYTHONOPTIMIZE=2` precompiled environment, they'd fail with this error because a new `.pyo` file would be created.:

    FAIL: test_basic (openerp.addons.module_auto_update.tests.test_addon_hash.TestAddonHash)
    Traceback (most recent call last):
    `   File "/opt/odoo/auto/addons/module_auto_update/tests/test_addon_hash.py", line 41, in test_basic
    `     'static/src/some.js',
    ` AssertionError: Lists differ: ['README.rst', 'data/f1.xml', ... != ['README.rst', 'data/f1.xml', ...
    `
    ` First differing element 13:
    ` models/stuff.pyo
    ` static/src/some.js
    `
    ` First list contains 1 additional elements.
    ` First extra element 14:
    ` static/src/some.js
    `
    `   ['README.rst',
    `    'data/f1.xml',
    `    'data/f2.xml',
    `    'i18n/en.po',
    `    'i18n/en_US.po',
    `    'i18n/fr.po',
    `    'i18n/fr_BE.po',
    `    'i18n/test.pot',
    `    'i18n_extra/en.po',
    `    'i18n_extra/fr.po',
    `    'i18n_extra/nl_NL.po',
    `    'models/stuff.py',
    `    'models/stuff.pyc',
    ` -  'models/stuff.pyo',
    `    'static/src/some.js']
    Ran 3 tests in 0.005s
    FAILED

With this patch, the `.pyo` file is included, so tests will pass anywhere.
2021-12-27 16:49:36 +02:00
Jairo Llopis 3f81cc8906 [REF] module_auto_update: Step 3, backwards compatibility
The previous implementation of this addon proved being extremely buggy:

- It supplied out of the box a enabled cron to update Odoo that didn't restart the server, which possibly meant that upgrades broke things.
- It overloaded standard Odoo upgrade methods that made i.e. installing an addon sometimes forced to upgrade all other addons in the database.
- The checksum system wasn't smart enough, and some files that didn't need a module upgrade triggered the upgrade.
- It was based on a dirhash library that was untested.
- Some updates were not detected properly.
- Storing a column into `ir.module.module` sometimes forbids uninstalling the addon.

Thanks to Stéphane Bidoul (ACSONE), now we have new methods to perform the same work in a safer and more stable way.

All I'm doing here is:

- Cron is disabled by default.
- Installed checksums are no longer saved at first install.
- Old installations should keep most functionality intact thanks to the migration script.
- Drop some duplicated tests.
- Allow module uninstallation by pre-removing the fields from ir.mode.model.
- When uninstalling the addon, the deprecated features will get removed for next installs always.

Besides that, fixes for the new implementation too:

- When uninstalling the addon, we remove the stored checksum data, so further installations work as if the addon was installed from scratch.
2021-12-27 16:49:36 +02:00
Stéphane Bidoul (ACSONE) a1f71e9ad6 [REF] module_auto_update: Step 2, add new API
This code comes from the module_checksum_upgrade proposal
at https://github.com/OCA/server-tools/pull/1176.

* [ADD] module_checksum_upgrade

It provides the core mechanism of module_auto_update without
the cron nor any change to the standard upgrade mechanism.
Instead it provides an API on which module_auto_update can build,
as well as a method which can be called from a script to run
the upgrade of modules for which the checksum has changed.

* [IMP] refactor module_auto_update

Make it depend on module_checksum_upgrade which provides
the core mechanisms of managing the checksums. module_auto_update
makes it automatic.

* [IMP] module_checksum_upgrade: better exclusion mechanism

Ignore files based on exclude patterns.
Ignore uninstalled languages.
Better default for patterns to ignore (*.pyc,*.pyo,*.pot,static/*)

For better control on the hashing mechanism implement our own:
it's quite easy, and the checksumdir module used previously had
no test.

* [MIG] module_auto_update: adapt to new checksum mechanism

* [IMP] module_checksum_upgrade: raise in case of
 incomplete upgrade

* [IMP] module_checksum_upgrade: improve default exclusion
 pattern

* [IMP] module_checksum_upgrade: control translations
 overwrite

* [IMP] module_checksum_upgrade: one more test

* [IMP] module_checksum_upgrade: credits [ci skip]
2021-12-27 16:49:36 +02:00
Jairo Llopis 015c18004d [REF] module_auto_update: Step 1, move all deprecated stuff to deprecated files
- Files are clearly suffixed with `_deprecated` so we know those features have no support nor migrations.
- Views are removed, since updating from UI was too buggy to support it anymore.
2021-12-27 16:49:36 +02:00
OCA Transbot 20f6a9dfb4 OCA Transbot updated translations from Transifex 2021-12-27 16:49:36 +02:00