[Openerp-community] renaming modules

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Openerp-community] renaming modules

Davide Corio-2
Hi *,
in case someone needs to rename a module, what should be the correct approach?
is it possibile to handle this via migration scripts? (rename everything…uninstall the old module...)

cheers,
--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl






_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Stefan Rijnhart (Therp)
On 01-07-14 08:17, Davide Corio wrote:
> Hi *,
> in case someone needs to rename a module, what should be the correct approach?
> is it possibile to handle this via migration scripts? (rename everything…uninstall the old module...)

Hi Davide,

untested, but I think the following could work:

- Rename the module
- Create a module that renames the XML-id's owned by the old module and
set the new module state to 'to upgrade'.
- Recreate the old module without any logic or data, depending on the
migration module.
- Run update --all first to reload the list of modules. Run --update all
again to upgrade the new module.
- Uninstall the old module and the migration module manually.

It would probably be a 10 line patch to support module renames in the
base module, using something like an 'oldname' directive in the manifest
file.

Cheers,
Stefan.

--
Therp - Maatwerk in open ontwikkeling

Stefan Rijnhart - Ontwerp en implementatie

[hidden email]
tel +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Ferdinand Gassauer
On 2014-07-01 09:27, Stefan wrote:

> On 01-07-14 08:17, Davide Corio wrote:
>> Hi *,
>> in case someone needs to rename a module, what should be the correct approach?
>> is it possibile to handle this via migration scripts? (rename everything…uninstall the old module...)
> Hi Davide,
>
> untested, but I think the following could work:
>
> - Rename the module
> - Create a module that renames the XML-id's owned by the old module and
> set the new module state to 'to upgrade'.
> - Recreate the old module without any logic or data, depending on the
> migration module.
> - Run update --all first to reload the list of modules. Run --update all
> again to upgrade the new module.
> - Uninstall the old module and the migration module manually.
>
> It would probably be a 10 line patch to support module renames in the
> base module, using something like an 'oldname' directive in the manifest
> file.
given the number of modules being around such a extension would be very
welcome
>
> Cheers,
> Stefan.
>


--
Ferdinand Gassauer
Eigentümer
ChriCar Bet. u. Ber. GmbH


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Graeme Gellatly
openupgrade.update_module_names(
        cr, module_namespec
        )

Just saying, works for me.


On Tue, Jul 1, 2014 at 9:00 PM, Ferdinand Gassauer <[hidden email]> wrote:
On 2014-07-01 09:27, Stefan wrote:
On 01-07-14 08:17, Davide Corio wrote:
Hi *,
in case someone needs to rename a module, what should be the correct approach?
is it possibile to handle this via migration scripts? (rename everything…uninstall the old module...)
Hi Davide,

untested, but I think the following could work:

- Rename the module
- Create a module that renames the XML-id's owned by the old module and
set the new module state to 'to upgrade'.
- Recreate the old module without any logic or data, depending on the
migration module.
- Run update --all first to reload the list of modules. Run --update all
again to upgrade the new module.
- Uninstall the old module and the migration module manually.

It would probably be a 10 line patch to support module renames in the
base module, using something like an 'oldname' directive in the manifest
file.
given the number of modules being around such a extension would be very welcome

Cheers,
Stefan.



--
Ferdinand Gassauer
Eigentümer
ChriCar Bet. u. Ber. GmbH



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Pedro Manuel Baeza Romero
Hi, Graeme, the problem is to make it regularly, not with OpenUpgrade method. Maybe what Ferdinand says about extracting this functionality and encapsulate it on a module (for server-env-tools repository?), and put it as a dependency of this bridge module are the ideal flow, don't you think?

Regards.


2014-07-01 11:25 GMT+02:00 Graeme Gellatly <[hidden email]>:
openupgrade.update_module_names(
        cr, module_namespec
        )

Just saying, works for me.


On Tue, Jul 1, 2014 at 9:00 PM, Ferdinand Gassauer <[hidden email]> wrote:
On 2014-07-01 09:27, Stefan wrote:
On 01-07-14 08:17, Davide Corio wrote:
Hi *,
in case someone needs to rename a module, what should be the correct approach?
is it possibile to handle this via migration scripts? (rename everything…uninstall the old module...)
Hi Davide,

untested, but I think the following could work:

- Rename the module
- Create a module that renames the XML-id's owned by the old module and
set the new module state to 'to upgrade'.
- Recreate the old module without any logic or data, depending on the
migration module.
- Run update --all first to reload the list of modules. Run --update all
again to upgrade the new module.
- Uninstall the old module and the migration module manually.

It would probably be a 10 line patch to support module renames in the
base module, using something like an 'oldname' directive in the manifest
file.
given the number of modules being around such a extension would be very welcome

Cheers,
Stefan.



--
Ferdinand Gassauer
Eigentümer
ChriCar Bet. u. Ber. GmbH



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Davide Corio-2
In reply to this post by Stefan Rijnhart (Therp)

On 01 Jul 2014, at 09:27, Stefan <[hidden email]> wrote:

> Hi Davide,
>
> untested, but I think the following could work:
>
> - Rename the module
> - Create a module that renames the XML-id's owned by the old module and
> set the new module state to 'to upgrade'.
> - Recreate the old module without any logic or data, depending on the
> migration module.
> - Run update --all first to reload the list of modules. Run --update all
> again to upgrade the new module.
> - Uninstall the old module and the migration module manually.
>
> It would probably be a 10 line patch to support module renames in the
> base module, using something like an 'oldname' directive in the manifest

Hi Stefan,
i’ll try this way then.

it would be really nice to have some sort of “replaces” attr in __openerp__, just like the “depends”.

btw, i just noticed this:
http://bazaar.launchpad.net/~openupgrade-committers/openupgrade-server/7.0/view/head:/openerp/addons/base/migrations/7.0.1.3/pre-migration.py#L27

--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl






_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Stefan Rijnhart (Therp)
On 01-07-14 15:02, Davide Corio wrote:
> btw, i just noticed this:
> http://bazaar.launchpad.net/~openupgrade-committers/openupgrade-server/7.0/view/head:/openerp/addons/base/migrations/7.0.1.3/pre-migration.py#L27

Yes, OpenUpgrade supports it ;-) but I thought you were talking in a
general context.


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Stefan Rijnhart (Therp)
In reply to this post by Davide Corio-2
The silly thing is that you need to uninstall the helper modules
manually anyway, so you might as well run the three required SQL queries
manually when you change the module name if you don't have a community
of users to support.

On 01-07-14 15:02, Davide Corio wrote:

> On 01 Jul 2014, at 09:27, Stefan <[hidden email]> wrote:
>> Hi Davide,
>>
>> untested, but I think the following could work:
>>
>> - Rename the module
>> - Create a module that renames the XML-id's owned by the old module and
>> set the new module state to 'to upgrade'.
>> - Recreate the old module without any logic or data, depending on the
>> migration module.
>> - Run update --all first to reload the list of modules. Run --update all
>> again to upgrade the new module.
>> - Uninstall the old module and the migration module manually.
>>


--
Therp - Maatwerk in open ontwikkeling

Stefan Rijnhart - Ontwerp en implementatie

[hidden email]
tel +31 (0) 614478606
http://therp.nl
https://twitter.com/therp_stefan


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] renaming modules

Davide Corio-2
In reply to this post by Stefan Rijnhart (Therp)

On 01 Jul 2014, at 16:03, Stefan <[hidden email]> wrote:
>
> Yes, OpenUpgrade supports it ;-) but I thought you were talking in a
> general context.

Yes, it was a bit more general actually :)


--
Davide Corio
[hidden email]
ERP Consultant
L.S. Advanced Software Srl






_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp