Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
13040 Vues

Hello,

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?

Avatar
Ignorer

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

Auteur

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

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.

Auteur

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.

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

Auteur

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!

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

Auteur

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

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

Auteur

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

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

Auteur

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

Meilleure réponse

FYI, I have this same issue.  It looks like the field became available on different models, and in those models, the type was set to "Base Field".  In the original model I put it in, it still had "Custom Field".  I was able to delete that field.  So perhaps  there is some kind of propagation error where the field is copied to other models where it can be used, and during the copy process it set's Base Field.  This might be a bug.


Avatar
Ignorer
Auteur Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

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.

https://dl.dropboxusercontent.com/u/42025188/default_field.png

https://dl.dropboxusercontent.com/u/42025188/custom_field.png

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
mai 16
5891
2
mars 15
8637
0
juil. 22
2500
1
janv. 24
6335
0
mai 22
2638