Skip to content

Commit

Permalink
[DOC] Describe how to propose a migration script to the community. (g…
Browse files Browse the repository at this point in the history
…it command, commit name convention, etc.)
  • Loading branch information
legalsylvain committed Nov 9, 2023
1 parent a51c36c commit afc124d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docsource/090_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,45 @@ In order to contribute to the OpenUpgrade project, please
database, and give back any code improvements developed during the project.


How to contribute new migration scripts
---------------------------------------

To Contribute to OpenUpgrade you must make one pull request per module.

For example, if you want to propose the migration script of the ``account``
module from version 15.0 to version 16.0:

* Always ensure that there is no work already in progress by a community member.
For that purpose, go the issue named "Migration to version 16.0" on github
`here <https://github.com/OCA/OpenUpgrade/issues/3681/>`_.

* Then, ensure that all the dependencies of the module are mark as ``done`` or
``Nothing to do`` in OpenUpgrade for that version.
For that purpose, refer to :doc:`030_coverage_analysis`.
In our example, check the ``depends`` key of the `manifest <https://github.com/odoo/odoo/blob/16.0/addons/account/__manifest__.py#L18>`_ of the ``account`` module
If some dependencies are missing, you should start by migrating these modules.

* As other OCA contribution, create a new branch, from an up to date OCA branch:

``git checkout -b 16.0-mig-account``

* Make a copy of the analysis file.

``cd ./openupgrade_scripts/scripts/account/16.0.1.2/``
``cp upgrade_analysis.txt upgrade_analysis_work.txt``

* Explain the changes to do in the ``upgrade_analysis_work.txt``.
Write ``pre-migration.py`` and / or ``post-migration.py`` scripts in the same folder.
Comment / uncomment lines in ``noupdate_changes.xml``.
(Read more in :doc:`080_migration_script_development`)

* Finally, commit your changes.
``git add . && git commit -am "[OU-ADD] account"``
(For a fix, use ``[OU-FIX]`` prefix)

* Propose your changes to the community, for review.
``git push MY_REMOTE 16.0-mig-account``

Community involvement
---------------------

Expand Down

0 comments on commit afc124d

Please sign in to comment.