Odoo Help

0

Fixing a custom field and database implications?

By
Chris Collins
on 9/11/15, 11:05 AM 930 views

I added a field x_part_number through the web interface.  This is before I realized it needed to be added by a custom module.  However we have over 6000 products and the x_part_number field is populated in every product.  

I want to create a custom module addon to add the part x_part_number instead and remove it from the way I added it in the web interface.   

Can I do this without it affecting the database?  If it will affect the database how can I fix it?

Hello, i took over the IT work chris, my name is Mike Ryder and i'm the marketing/IT/designer here at 911 Fleet & Fire Equipment. We are having a big issue where we are not able to login to our odoo software. When we visit the link where it is hosted it will not bring up anything, only a message saying the connection is refused. I need help getting this back up and running asap because we have salesmen needing access. Please contact me as soon as you're able to at (513) 200-3004. Thank you.

Chris Collins
on 5/17/16, 11:03 AM

@Chris - this is not the place to ask for urgent support. First, you are hijacking an unrelated thread, second you are asking in a place where nobody is guaranteed to read your post. You need to contact the hosting provider (either Odoo or who set it up for you).

Bista Solutions US, Ray Carnes
on 5/17/16, 4:41 PM

Sorry, i thought you worked for Odoo. Also, i dont know anything about Odoo so i thought this was a messenger type system and not just a forum thread that could be "hijacked". And i've tried contacting Odoo but no one has contacted me back. But never mind, i'll keep searching on my own for who to contact since apparently no one at Odoo cares about customer support once someone has bought their product.

Chris Collins
on 5/19/16, 9:29 AM

Call the San Francisco office - details at https://www.odoo.com/page/contactus

Bista Solutions US, Ray Carnes
on 5/20/16, 11:45 AM
0
Ray Carnes
On 9/11/15, 5:13 PM

Now that you've created it, it's probably easier to leave it alone.

It doesn't need to be in a custom module.  Fields are prefixed with x_ specifically so they will not be removed during upgrades.  It is certainly more convenient for it to be in a custom module, but technically it isn't necessary.

To remove it you need to reverse the SQL changes made to the database when it was created, which includes updating Odoo metadata tables.

This is what happens when you add a simple field to an Odoo model:

  1. A row is inserted in ir_model_fields

  2. The table in PostgreSQL is altered to have the new column added

Reverse these and the field is gone.

Warning: You will lose all the data in this field, so make sure you have a copy if you need it.

 

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 9/11/15, 11:05 AM
Seen: 930 times
Last updated: 5/19/16, 9:29 AM