{"id":31547272,"url":"https://github.com/oca/odoo-module-migrator","last_synced_at":"2025-10-04T15:58:33.969Z","repository":{"id":40304092,"uuid":"203574253","full_name":"OCA/odoo-module-migrator","owner":"OCA","description":"Python library to migrate odoo base code from a version to another","archived":false,"fork":false,"pushed_at":"2025-09-29T20:38:15.000Z","size":196,"stargazers_count":187,"open_issues_count":54,"forks_count":150,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-09-29T22:29:48.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCA.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"OCA"}},"created_at":"2019-08-21T11:55:50.000Z","updated_at":"2025-09-29T20:38:18.000Z","dependencies_parsed_at":"2023-11-09T11:42:49.845Z","dependency_job_id":"dc86ceed-a638-4be2-a1f9-97167d945c7c","html_url":"https://github.com/OCA/odoo-module-migrator","commit_stats":null,"previous_names":["grap/odoo-module-migrator"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/OCA/odoo-module-migrator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Fodoo-module-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Fodoo-module-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Fodoo-module-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Fodoo-module-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCA","download_url":"https://codeload.github.com/OCA/odoo-module-migrator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Fodoo-module-migrator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278335452,"owners_count":25970129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-04T15:58:31.637Z","updated_at":"2025-10-04T15:58:33.961Z","avatar_url":"https://github.com/OCA.png","language":"Python","funding_links":["https://github.com/sponsors/OCA"],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg\n    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n    :alt: License: AGPL-3\n.. image:: https://img.shields.io/badge/python-3.6-blue.svg\n    :alt: Python support: 3.6\n.. image:: https://app.travis-ci.com/OCA/odoo-module-migrator.svg?branch=master\n    :target: https://app.travis-ci.com/OCA/odoo-module-migrator\n\n====================\nodoo-module-migrator\n====================\n\n``odoo-module-migrator`` is a python3 library that allows you to automatically migrate\nmodule code to make it compatible with newer Odoo versions.\nFor example:\n\n* renaming ``__openerp__.py`` file to ``__manifest__.py``\n* removing ``# -*- encoding: utf-8 -*-`` since V11.0\n* replacing ``openerp`` import with ``odoo`` import\n* removing ``migrations`` folders\n* changing \u003cact_window\u003e to \u003crecord model=\"ir.actions.window\"\u003e\n* ...\n\nThis library will:\n\n* (optionally) get commits from the old branch (if format-patch is enabled)\n* automatically apply changes (renaming, replacing, etc.)\n* commit your changes\n* display warnings or errors in the log if your code contains obsolete code patterns\n\nThis project is about migrating code. If you're looking for database data migration\nbetween Odoo versions, check out the https://github.com/OCA/OpenUpgrade project.\n\n**INFO log**\n\nIndicates that the library automatically changed something.\n*A priori* you have nothing to do. For example, for a migration from 8.0 to\na more recent version:\n\n.. code-block:: shell\n\n    12:38:54 INFO Renaming file: '/my_module/__openerp__.py' to '/my_module/__manifest__.py'\n\n**WARNING log**\n\nIndicates that you should check something. There may be something to do\nto make the module work. For example:\n\n.. code-block:: shell\n\n    19:37:55 WARNING Replaced dependency of 'account_analytic_analysis' with 'contract' (Moved to OCA/contract)\n\n**ERROR log**\n\nIndicates that you must change something in your code. If not, the module\nwill not work *for sure* (not installable or generating errors during\nexecution).\n\nFor example, if you have an 8.0 module that depends on 'account_anglo_saxon',\nwhich disappeared in more recent versions, the following log will be displayed:\n\n.. code-block:: shell\n\n    12:38:54 ERROR Depends on removed module 'account_anglo_saxon'\n\nDevelopment and Improvement\n===========================\n\nIf you want to improve or contribute to this library, please read the\n``DEVELOP.rst`` file and the 'Roadmap / Known Issues' sections.\n\nInstallation\n============\n\n.. code-block:: shell\n\n    pip3 install odoo-module-migrator\n\nUsage\n=====\n\nUsing Format Patch command\n--------------------------\n\n(Recommended by the OCA)\n\nIf you want to migrate an Odoo module from version 8.0 to 12.0, for example,\nthe module ``pos_order_pricelist_change`` in the OCA \"pos\" repository:\n\n.. code-block:: shell\n\n    git clone https://github.com/OCA/pos -b 12.0\n    cd pos\n    odoo-module-migrate\n        --directory             ./\n        --modules               pos_order_pricelist_change\n        --init-version-name     8.0\n        --target-version-name   12.0\n        --format-patch\n\nWithout format Patch command\n----------------------------\n\n(Mainly for your custom modules)\n\nIf you have created a new branch (for example 12.0) based on your 10.0 branch,\nyou can run the following command:\n\n.. code-block:: shell\n\n    odoo-module-migrate\n        --directory             /path/to/repository\n        --modules               module_1,module_2,module_3\n        --init-version-name     10.0\n        --target-version-name   12.0\n\nThis tool will operate the changes for each module.\n\nAvailable Arguments\n-------------------\n\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n| Name                     | Shortcut | Options         | Description                                           |\n+==========================+==========+=================+=======================================================+\n|``--directory``           | ``-d``   | Default:        | Local folder that contains the module(s) to migrate.  |\n|                          |          | ``./``          |                                                       |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--init-version-name``   | ``-i``   | Required        | Initial version of your module(s) you want to migrate.|\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--target-version-name`` | ``-t``   | Default:        | Final version you want to migrate to.                 |\n|                          |          | the latest Odoo |                                                       |\n|                          |          | version         |                                                       |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--modules``             | ``-m``   | Default:        | Module(s) to migrate. Note: if the format-patch option|\n|                          |          | All modules     | is enabled, you have to provide only one module.      |\n|                          |          | in the          |                                                       |\n|                          |          | directory       |                                                       |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--format-patch``        | ``-fp``  | Disabled        | Recover code using the git format-patch command.      |\n|                          |          | by default      |                                                       |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--remote-name``         | ``-rn``  | Default:        | Name of the main remote used by the format-patch      |\n|                          |          | ``origin``      | command.                                              |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--log-level``           | ``-ll``  | Default:        | Possible values: ``DEBUG``, ``INFO``, ``WARNING``,    |\n|                          |          | ``INFO``        | etc.                                                  |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--log-path``            | ``-lp``  | Default:        | If set, logs will not be displayed on screen,         |\n|                          |          | False           | but stored in a file.                                 |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n|``--no-commit``           | ``-nc``  | Default:        | If set, the library will not git add and git commit   |\n|                          |          | commit          | changes.                                              |\n+--------------------------+----------+-----------------+-------------------------------------------------------+\n\nRoadmap / Known Issues\n======================\n\n* The replacement of the tag \u003copenerp\u003e\u003cdata\u003e with \u003codoo\u003e will fail in cases\n  where there are many \u003cdata\u003e occurrences.\n  We could fix that by using the ``lxml`` library instead of regular expressions.\n\n* Add a call to ``pre-commit run -a``, if pre-commit is present in the\n  repository.\n\nChanges\n=======\n\n0.3.2 (December 04, 2019)\n-------------------------\n* [REM] Remove black call (add call to a more generic tool pre-commit\n  in the roadmap).\n* [IMP] Add --no-verify option in ``git commit`` to avoid failure if pre-commit\n  is present.\n* [REF] Refactor ``_execute_shell`` function.\n\n0.2.0 (October 13, 2019)\n------------------------\n* Second release.\n\n0.1.4 (October 12, 2019)\n------------------------\n* Test\n\n[ADD] test.\n\n* Framework\n\n[ADD] ``--file-path`` option.\n[ADD] ``_DEPRECATED_MODULES`` syntax.\n\n* Migration script\n\n[FIX] Incorrect syntax of regular expression to remove python 2 header.\n[IMP] First release of all the steps from 8.0 to 13.0.\n\n0.1.3 (October 11, 2019)\n------------------------\n\n* Framework\n\n[ADD] ``--no-commit`` option that disables git add and git commit calls.\n[FIX] Do not commit many times if migration has many steps.\n[REF] Remove useless commented code.\n[REF] Create ``_commit_changes()`` and ``_replace_in_file()`` functions.\n\n* Meta\n\n[FIX] GitHub URL of the project in setup.py.\n[ADD] Travis file + links to coveralls.\n[ADD] test_requirements.txt.\n\n* Migration script\n\n[ADD] Migration from 12.0 to 13.0 and add a warning if references to web_settings_dashboard are found, courtesy of @yelizariev.\n[ADD] Bump version in manifest file.\n[ADD] Set installable to True.\n\n0.1.2 (October 10, 2019)\n------------------------\n\n* First release.\n\nCredits\n=======\n\nAuthors\n-------\n\n* GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)\n\nContributors\n------------\n\n* Sylvain LE GAL (https://www.twitter.com/legalsylvain)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foca%2Fodoo-module-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foca%2Fodoo-module-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foca%2Fodoo-module-migrator/lists"}