Odoo Help

0

Models left when uninstalling my custom module

By
Micke
on 1/23/17, 4:00 PM 703 views

I have a custom module that has two models, simplified:

class bom_checker_how_many(models.Model):
     _name = 'mrp.bom.howmany'
    bom_line_stat_ids = fields.One2many('mrp.bom.howmany.bom_line_stat','bom_checker_id') 

class bomLineStat(models.Model):
     _name = 'mrp.bom.howmany.bom_line_stat'
    bom_checker_id = fields.Many2one('mrp.bom.howmany')

The module works good, but when I want to uninstall it I get an error message that it can't delete the model due to it's dependency to the other model. So when I hit "Uninstall", the module is only partly removed.

Now, the models are left behind in the database, so when I try to install the module, I get another error saying that it can't install because that the models are already existing.

1. Should I declare my models any different to be able to uninstall/install properly?

2. Can I in an easy way manually remove the models from the database? I can't do it through the GUI, it says "Model 'mrp.bom.howmany' contains module data and cannot be removed!"

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: 1/23/17, 4:00 PM
Seen: 703 times
Last updated: 1/23/17, 11:03 PM