Skip to Content
Menu
This question has been flagged
1 Reply
17016 Views

I have already tried to implement solutions I found in this forum regarding my issue, but it didn't work. So...

I created a field in my model, but then I decided that I don't need it anymore, so I removed it from the models.py and views.xml. Restarted the server, my field is not on the view/form anymore, but if I go to settings/technical/database structures/fields and search for that field that I deleted earlier it shows me in the list and that it belongs to my model.

I went to a DB and this field is there too. So I dropped that field manually from the table, but I still can see it in Odoo if I search it in settings.  

I uninstalled my module and installed it back, but I still can find it in Odoo in settings.

I tried to delete it through Odoo UI in settings, but I couldn't do it:

This column contains module data and cannot be removed!

I've no idea what data it contains.

I also updated everything through the command line: 

./odoo-bin -c /path-to-my-config-file/file_name.cfg -u all -d db_name

But that field is still in Odoo.

Maybe it's still in the database... Any thoughts?

Avatar
Discard
Best Answer

did you try this :  https://www.odoo.com/fr_FR/forum/aide-1/question/delete-fields-from-database-without-uninstall-89352

Avatar
Discard

I suggest you update the module 'base' before you try Benjamin's solution.

Author

I have updated 'base' module and it didn't help me, I also updated all modules and it didn't help me. Didn't try Benjamin's solution yet.

Author

So here is how it works for me:

After restarting Odoo server those fields that I deleted from the model and view didn't fell out. I checked my db and they were still there. Then I uninstalled my module. I went to Accounting module where I was customizing "res.partner" form and I didn't see those fields that I deleted earlier, which is what I expected, but I was still able to see other custom fields that I didn't delete from the model and view even after I uninstalled the whole module. So then I updated the Accounting module and only after that those other custom fields that I saw earlier where gone (actually later I just refreshed a browser and fields were gone).

However, at this point I went and checked my db. Those custom fields that I didn't delete from the model/view fall out from the db, but those fields that I deleted from the model/view were still there. So if I understand everything right then if I want to delete my custom fields from the db I need to:

1) uninstall my module;

2) refresh browser;

3) delete unnecessary custom fields from the model and view;

4) install my module back without those unnecessary fields.

So when I go to settings/database structure/fields and search for my custom fields Odoo doesn't show them to me anymore, which is what I expected.

Related Posts Replies Views Activity
0
Nov 18
1627
2
Nov 18
6742
1
Sep 17
2645
1
Mar 15
8714
1
Mar 24
738