OCA / odoo-module-migrator

Python library to migrate odoo base code from a version to another
GNU Affero General Public License v3.0
123 stars 112 forks source link

Master add views migration 17 #83

Closed jjscarafia closed 9 months ago

jjscarafia commented 9 months ago

@pedrobaeza what do you think about this?

Making this script a commont script inside the tool was to heavy. We've created a new folder "addons" and a new module to help on views migration on 17.

We've been using it and is working like a charm.

Simply:

  1. run odoo-module-migrate as always
  2. install modules changing server wide modules so that the patch is loaded and views are fixed. for eg: odoo -i [module_name] -d [database_name] --load=base,web,views_migration_17
pedrobaeza commented 9 months ago

Yes, I also see weird to require a module to do this.

jjscarafia commented 9 months ago

I also see it weird. But to be honest we've been using this to migate modules and it's awesome. It fix all the views. For me, no problems not to merge it. I don´t see any nicier not so difficult solution.

If you prefer, we can close the pr.

We create it because we believe it could help a lot to migrate modules.

The approach is not nice but it works.

A dedicated hosted repository looks good to me, but I feel that it could be too much. For now it's just for this module, this use case of migration between 16 and 17.

Thanks you both!

pedrobaeza commented 9 months ago

But why the same algorithm can't be done with regular Python code as the rest of the module migrator does?

jjscarafia commented 9 months ago

Hi @pedrobaeza We've started doing so but it was taking more time that the one available on our side. There are some challengues as:

pedrobaeza commented 9 months ago

Yeah, I see. I understand if the work is very huge and you don't want to continue. The problem is that this library wants to be independent from Odoo and light, so doing that way will compromise the foundation principles. A new repo or server-tools module can be added though.

jjscarafia commented 9 months ago

thanks @pedrobaeza So proposing this module on server-tools for v17 seems a good one? If I'm not wrong, the mdoule can be uninstallble and still be loaded for the patch. So with a good readme it will not break anything.

pedrobaeza commented 9 months ago

Yeah, I think so.

bruno-zanotti commented 9 months ago

Hey @pedrobaeza @jjscarafia, here it is the new PR https://github.com/OCA/server-tools/pull/2775, it perfectly works with the module uninstallable=False.. I think we can go ahead, merge it and close this one.