Odoo Help


Custom field to base field

Panagiotis Bekiaris
on 1/13/14, 7:07 AM 4,595 views


I'm experiencing a strange functionality when I create a custom field. I use Openerp v.7. Either the field is created from Technical->Database Structure->Fields or inside the related Model, sometimes it is converted to a base field. I can't figure out how this is done, the name of the field starts with an x_ as it should and at the creation field form I can see it is of type Custom Field before saving. After saving and reloading the page I just see that the type has changed. Moreover, I can't delete that field or use it in a view because it throws xml validation error.

Does anyone know why this is happening or how can I deal with this?

Are you saying that the field is changing from a Custom Field to a Base Field after its saved?

on 1/13/14, 4:52 PM

Yes, that's what I'm saying. The Type of the field changes without being able to control it.

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 8:19 AM

That is strange. So does it still have the x_ appended to the front of the name after it's saved? Or is it cropped off once the field is saved? Does the xml view have that name spelled the same way on it? Because I know it will cause that xml validation error if the view doesn't recognize another field because the name is spelled differently.

on 1/14/14, 2:00 PM

No, it still has the x_. However, I'm not able to use it in the view at all. It throws xml validation error. This is how I noticed the problem the first time. I created a field inside a model and then went to edit the view and it caused validation error. I also searched the database to see if there was a column with that name but nothing. It's like that I can see the field in the field list but it doesn't really exist. I also restarted the service but nothing changed.

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 2:12 PM

What message do you get when you try deleting the field?

on 1/14/14, 2:21 PM

On Delete I get this:Error This column contains module data and cannot be removed! On edit I get:Error!

Properties of base fields cannot be altered in this manner! Please modify them through Python code, preferably through a custom addon!

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 2:26 PM

On Delete, does the error tell you what table the module data exists in?

on 1/14/14, 2:31 PM

Do you mean on the delete pop-up window? No, there it doesn't say anything else. If it helps, I had created the field inside the res.partner model and I can see it in the model's field list and in form view of the field it also says model:Partner

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 2:37 PM

if you open your Postgres database, and look up the table ir_model_fields, do you see the field exist in there?

on 1/14/14, 2:47 PM

Yes, I can see it there. On state it says "base". Should I deleted from there?

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 3:11 PM

Yes I would delete it from there. Then restart your service and clear your browsing history also. This way you should get a fresh start

on 1/14/14, 3:22 PM

It is really weird how this has happened at first.Thanks a lot for your help!

Means4.com Group, Panagiotis Bekiaris
on 1/14/14, 3:25 PM
Ken Tong
On 10/3/14, 4:37 AM

Dear All,

I encountered this problem when trying to set "required" for custom field. The error did not prompt when I did not key into the field.

For the default field (base), the erir will prompt if  I did not key in the field.

Anyone know what is the problem?? Thanks in advance.



Panagiotis Bekiaris
On 1/14/14, 8:09 AM

Yes, that's what I'm saying. The Type of the field changes without being able to control 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.


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

0 follower(s)


Asked: 1/13/14, 7:07 AM
Seen: 4595 times
Last updated: 3/16/15, 8:10 AM