Comment 3 for bug 698023

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: null value in column "categ_id" violates

Hello everyone,

The problem here is not the fact that there is an error message in the server console, which is totally normal and in fact helps to understand the issue.
The problem is that even after deleting all products in a given category, the category cannot be deleted because the product.templates have not been deleted and still reference it.

This needs to be fixed in the product module, for example with a custom unlink() of the product.product object, which unlink() the product.template as well if the last product.product for this template is being deleted. This way when all products in a category have been deleted, the category can be deleted too.

Workaround: create a menu to open the list of product.templates and cleanup the templates directly from there: open the product.template object via Administration>Customization>Database structure>Objects, and click on 'Create a menu'