Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Rename a model field, how to propagate change to database schema?

By
Ben Finney
on 4/13/15, 1:14 AM 680 views

How can I rename a field in the model code, e.g. `FooModel`, so that the changes propagate correctly to the database schema?

I would like to rename e.g. `spam` to `beans` in the `FooModel._columns`. But how can I ensure that the same column rename occurs in the database when I update the OpenERP server code?

I can just rename the field in the Python code for the model, of course. But how will Odoo know which field was renamed to what? What if I rename several fields at once? What if I rename one field, delete another, and create another? How can I signal to Odoo which new fields are renames?


0
Ron Arts
On 4/26/15, 1:14 PM

I rename fields all the time. All that is needed is restarting Odoo, followed by an upgrade of the module that implements the field. Odoo will take care of the schema. 

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!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 4/13/15, 1:14 AM
Seen: 680 times
Last updated: 4/27/15, 9:06 PM