Odoo Help

Welcome!

This community 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.

0

delete all products

By
hajar el hamdani
on 9/1/14, 5:56 AM 1,843 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

0
Narayanamurthy
On 9/1/14, 6:04 AM

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

 

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

Pascal Tremblay
on 10/6/14, 4:42 PM

SQL Query : TRUNCATE product_product CASCADE

Pascal Tremblay
on 10/6/14, 4:52 PM
0
Anand Patel
On 10/7/14, 3:02 AM

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

-1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 10/6/14, 5:43 PM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/1/14, 5:56 AM
Seen: 1843 times
Last updated: 3/16/15, 8:10 AM