Skip to Content
Menu
This question has been flagged
3 Replies
15785 Views

Hello everybody,

i want to delete all the list of products to have a clear database and create new ones this error message is always shown

Integrity Error

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Stock Move - stock.move]

i tried to cancel all operations that have a relationship with those products,  but without success 

if you have an other suggestion please share it with me

Avatar
Discard
Best Answer

If u Donot need the stock_picking Records then

First u Delete all Records in stock_move and stock_picking in the backend

by Query "delete from stock_picking"

otherwise

try "Truncate Cascaded" For the product_product

 

Avatar
Discard

What do you mean by "Truncate Cascaded"? Where it is?

SQL Query : TRUNCATE product_product CASCADE

Best Answer

If you want to delete all the products then you have to unlik that products form the associted records with that prodict.

Like stock move,sale order, purchase order, invoive etc...So first you need to check that where this prodict is associated and then you need to unlik that product and then you can delete that product or you can delete all those entries which are associated with that product

Avatar
Discard
Best Answer

Here is my SQL query :

DELETE FROM stock_picking;

DELETE FROM stock_move;

DELETE FROM stock_move;

DELETE FROM mrp_production; 

DELETE FROM sale_order;

DELETE FROM procurement_order;

TRUNCATE product_product CASCADE

It seems to still have integrity problem in my products... Should I add something to my SQL query to delete ALL TRACES of products?

Grrrrr

Thanks

Avatar
Discard