Odoo - OpenERP - How to Rename an addon or custom module without losing data ?

Support
Support
5000
| 2 1 2
Asked on 9/9/15, 4:18 PM
0
vote
2879 Views

Rename addon

Change __openerp__.py addon name field
Change README.rst file
Change translations files (i18n folder, .po and .pot files)


cd i18n
sed -i 's/#\(.*\)\* <old_name>/#\1* <new_name>/g' *.po*
sed -i 's/#\. module: <old_name>/#. module: <new_name>/g' *.po*
sed -i 's/#: view:\(.*\):<old_name>/#: view:\1:<new_name>/g' *.po*
sed -i 's/#: model:\(.*\),name:<old_name>/#: model:\1,name:<new_name>/g' *.po*

Change XML ID (module part) on views, templates, records, ...

Execute these SQL queries

UPDATE ir_module_module SET name = '<new_name>' WHERE name = '<old_name>';
UPDATE ir_model_data SET module = '<new_name>' WHERE module = '<old_name>';
UPDATE ir_model_data SET name = 'module_<new_name>' 
       WHERE name = 'module_<old_name>' 
       AND module = 'base' 
       AND model = 'ir.module.module';
UPDATE ir_module_module_dependency SET name = '<new_name>'
       WHERE name = '<old_name>';
UPDATE ir_translation SET module = '<new_name>'
       WHERE module = '<old_name>';

Update any addon that depends on this one

Change __openerp__.py addon depends field

Restart Odoo

Update new addon

This will update any translation

Support
Support
5000
| 2 1 2
Answered on 9/9/15, 4:28 PM
0
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This forum is for HiTechnologia Employees & just Odoo general knowledge purpose only.

Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 9/9/15, 4:18 PM
Seen: 2879 times
Last updated: 9/9/15, 4:28 PM