Package: odoo-module-migrator
odoo-module-migratorodoo-module-migratoris a python3 library that allows you to automatically migrate
module code to make it compatible with newer Odoo version.
for exemple:renaming__openerp__.pyfile into__manifest__.pyremoving#-*-encoding:utf-8-*-since V11.0replacingopenerpimport byodooimportremovingmigrationsfolderschanging <act_window> to <record model=”ir.actions.window”>…This library will so:(optionnaly) get commits from the old branch (if format-patch is enabled)apply automatically changes. (renaming, replacing, etc.)commit your changes.Display warnings or errors in log if your code belong obsolete code patterns.This project is about migrating code. If you’re looking for database data migration
between Odoo versions, take a look
at thehttps://github.com/OCA/OpenUpgradeproject.INFO logIt mentions that the lib automatically changed something.A prioriyou have nothing to do. For example, for a migration from 8.0 to
a more recent version:12:38:54INFORenamingfile:'/my_module/__openerp__.py'by'/my_module/__manifest__.py'WARNING logIt mentions that you should check something. There ismaybesomething to do
to make the module working. For exemple:19:37:55WARNINGReplaceddependencyof'account_analytic_analysis'by'contract'(MovedtoOCA/contract)ERROR logIt mentions that you should change something in your code. It not, the module
will not workfor sure. (not installable, or generating error during the
execution)For example, if you have a 8.0 module that depends on ‘account_anglo_saxon’,
that disappeared in more recent version, the following log will be displayed12:38:54ERRORDependsonremovedmodule'account_anglo_saxon'Development and improvmentIf you want to improve or complete this library, please read theDEVELOP.rstfile and the ‘Roadmap / Know issues’ sections.Installationpip3installodoo-module-migratorUsageUsing Format Patch command(Recommanded by the OCA)If you want to migrate an Odoo module from a version 8.0 to 12.0, for exemple
the modulepos_order_pricelist_changein the OCA “pos” repository.gitclonehttps://github.com/OCA/pos-b12.0cdposodoo-module-migrate--directory./--modulespos_order_pricelist_change--init-version-name8.0--target-version-name12.0--format-patchWithout format Patch command(Mainly for your custom modules)if you have created a new branch (for exemple 12.0) based on your 10.0 branch
you can run the following commandodoo-module-migrate--directory/path/to/repository--modulesmodule_1,module_2,module_3--init-version-name10.0--target-version-name12.0This tools will operate the changes for each module.Available argumentsnameshortcutOptionsdescription--directory-dDefault:./Local folder that belongs the module(s) to migrate.--init-version-name-iRequiredInitial version of your module(s) you want to migrate.--target-version-name-tDefault:
the laster odoo
versionFinal Version you want to migrate.--modules-mDefault:
All modules
present in the
directoryModule(s) to migrate. Note if format-patch option is
enabled, you have to provide only one module.--format-patch-fpdisabled
by defaultRecover code, using git format-patch command.--remote-name-rnDefault:originName of the main remote, used by format-patch command.--log-level-llDefault:INFOPossible value:DEBUG,INFO,WARNING, etc.--log-path-lpDefault:
FalseIf set, the logs will not be displayed at screen,
but stored in a file--no-commit-ncDefault:
commitIf set the library will not git add and git commit
changes.Roadmap / Know issuesreplacement of tag <openerp><data> by <odoo> will fail in the case
where there are many <data> occurency.
We could fix that, usinglxmllib instead of regular expression.Add a call topre-commitrun-a, if pre-commit is present in the
repository.Changes0.3.2 (December 04, 2019)[REM] Remove black call. (Add call to more generic tool pre-commit
in the roadmap)[IMP] Add –no-verify option ingit committo avoid to fail if pre-commit
is present[REF] Refactor_execute_shellfunction0.2.0 (October 13, 2019)Second release0.1.4 (October 12, 2019)Test[ADD] testframework[ADD]--file-pathoption.
[ADD]_DEPRECATED_MODULESsyntax.migration script[FIX] Incorrect syntax of regular expression, to remove python 2 header
[IMP] first release of all the steps from 8.0 to 13.00.1.3 (October 11, 2019)framework[ADD]--no-commitoption that disable git add and git commit calls
[FIX] do not commit many times if migration has many steps.
[REF] remove useless commented code
[REF] create _commit_changes() and _replace_in_file() functionsMeta[FIX] github url of the project in setup.py
[ADD] Travis file + links to coveralls
[ADD] test_requirements.txtmigration script[ADD] 12.0 to 13.0 and add a warning if reference to web_settings_dashboard are found. cortesy @yelizariev
[ADD] bump version in manifest file
[ADD] set installable to True0.1.2 (October 10, 2019)First releaseCreditsAuthorsGRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)ContributorsSylvain LE GAL (https://www.twitter.com/legalsylvain)