Skip to Content

How to rename Odoo module without losing data!

Author
SerpentCS
September 2015 - 1 min read
Share

Hello Odoo User/Developer, While developing the module, we always face the issues of renaming the module midway and this again becomes headache for us. Antonio Espinosa from Madrid has done a nice job of sharing this tip here. We are glad to share on the bigger platform with all courtesy and thanks to him.

Odoo - Rename an addon without losing data

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 -------------------------------- Serpent Consulting Services Pvt. Ltd. is providing various ODOO services in more than 42 countries. Our services includes Training, Support, Migration, Implementation, Development and offshore. We are a team of 60+ full time OpenERP/ODOO experts including 4 techno functional experts who were part of core openerp framework development and having 8+ years of experience in OpenERP. We have conducted 56+ local and international functional and technical training on OpenERP with 90% satisfaction ratio. Look at the events and customer feedback. Thanks.



Table of Contents
Click to Add Image

End-to-End Odoo Services

From implementation and customization to migration, integrations, support, and training we help you maximize the value of Odoo.

Get Started
Search

Book Free Demo

Get real-time responses. Talk with our Industry Experts.

Professional Author

Author
SerpentCS

Created by the SerpentCS Editorial Team, delivering trusted insights on Odoo, ERPNext, Zoho, SAP, custom
software development, and enterprise technology to help businesses grow smarter.

Ready to Take the Next Step?

Whether you're planning a new ERP implementation, migrating from legacy software,
or optimizing your existing system, our experts are here to help.

Tags: odoo