Skip to Content

Contributors

Re: New library to migrate Odoo module code "odoo-migrate"

Awesome idea, Sylvain! 

+1 for the renaming as Pedro suggested and integration in  the
maintainer-tools repo.

Cheers and nice weekend

Frederik

Am Freitag, den 11.10.2019, 07:21 +0000 schrieb Pedro M. Baeza
(Tecnativa):

> Hi, Sylvain,

> 

> Excelent initiative! I think we can move it to OCA, but a better name

> would be odoo-oca-module-migrator, as it avoids confusion with the

> migration process through OpenUpgrade or similar, and it also ties it

> to OCA specific process.

> 

> I think this can't be inside maintainer-tools, as it would require

> specific folder structure for pypi publishing.

> 

> Regards.

> _______________________________________________

> Mailing-List: https://odoo-community.org/groups/contributors-15

> Post to: mailto:contributors@odoo-community.org

> Unsubscribe: https://odoo-community.org/groups?unsubscribe

-- 
Dr.-Ing. Frederik Kramer
Geschäftsführer
        
initOS GmbH
An der Eisenbahn 1
21224 Rosengarten
        
Phone:  +49 4105 56156-12
Fax:    +49 4105 56156-10
Mobil:  +49 179 3901819
        
Email: frederik.kramer@initos.com
Web:   www.initos.com
        
Geschäftsführung:
Dr.-Ing. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRB 205226
Steuer-Nr: 15/200/53247
USt-IdNr.: DE815580155


by Frederik Kramer - 09:41 - 11 Oct 2019

Reference

  • New library to migrate Odoo module code "odoo-migrate"
    Dear OCA Contributors,

    I am working on a migration from 8.0 to 12.0.
    For that purpose, I had to migrate a lot a modules. (about 50 OCA modules, and >100 custom modules)
    A lot of changes are very recurrent, and automatable. (removing python2 header, renaming __openerp__.py into __manifest__.py, changing import).

    I began to make some scripts, and finally began to create a new python3 library, to make that work. The name is "odoo-migrate" and the description is available here https://pypi.org/project/odoo-migrate/. and can be installed with the command
    pip3 install odoo-migrate

    Once installed, you can run the following command (other options are available)
    odoo-migrate -m my_module_name -i 8.0 -t 12.0

    It is based on the OCA recommendations available on this wiki.
    In addition to performing recurring operations,
    - the library also execute the weird format-patch command which I never remember (if asked).
    - it displays some warning if some patterns are found. (for example, if "ir.values" is found in a module 11+)
    - it calls black for recent version
    - it realize commits

    1) If you're interested by such tool, you can review or test this project.

    2) If you want to contribute, feel free, especially if you love regular expressions. It is still WIP, and there is a lot of work to do, like making change in xml file. (replacing openerp + data by odoo tag). Also adding test and plug with travis could be great.

    3) if some OCA members are OK, I can transfer this project under OCA umbrella.

    thank you for your feedback.

    kind regards.


    Sylvain LE GAL - Twitter
    GRAP - Service informatique (Groupement Régional Alimentaire de Proximité)
    Site Web | FramaSphere | Facebook
    3 Grande rue des Feuillants, 69001 Lyon
    Bureau : (+33) 09.72.32.33.17 - Astreinte : (+33) 06.81.85.61.43
    Member of the OCA (Odoo Community Association)

    by Sylvain LE GAL - 06:10 - 10 Oct 2019