Skip to Content
Menu
This question has been flagged
2 Replies
1745 Views

Hey Everyone. feeling stuck.
truely, its 13,000 items in inventory and each item has approx 3 boms attached. so its almost 40000 BOM entries.

--------------------------------------------------------

TEST 1 ( this addon), cleans other stuff, but not BOMs
https://apps.odoo.com/apps/modules/16.0/bi_mass_clear_data
---------------------------------------------------------
TEST 2 i tried this addons, even though it claims to do so , but fails. 

https://apps.odoo.com/apps/modules/13.0/clean_data/

ontacting dev also didn't helped. so now, 

---------------------------------------------------------


Q. how dangerous is to delete all entries from database directly using some DBADMIN tool like pgAdmin / dBeaver. ?

Q. do i need to delete mrp.bom (table entrries) ?  
Q or should i delete mrp.bom.lines (table entiesas well)? or deleting above will delete these automatically.?
Q. what is exact sql cmd to delete all BOM table entries.?
thanks in advance for all the help.

regards, haseeb

Avatar
Discard
Best Answer

Deleting data directly from the database using a tool like pgAdmin or dBeaver can be dangerous if you are not careful. It is not recommended to delete data directly from the database unless you are very familiar with the database structure and you have a backup of the database.

Before deleting any data from the database, it is important to understand the consequences of deleting that data. Deleting BOM entries can have a significant impact on your inventory management and production planning. If you delete BOM entries, you may need to recreate them manually, which can be a time-consuming process.

If you decide to delete BOM entries, it is recommended to use the Odoo application's built-in functionality to do so. The safest way to delete BOM entries is to use the "Delete" button in the BOM form view in Odoo. This will ensure that all related data is also deleted, including the BOM lines.

If you still want to delete BOM entries directly from the database, you can do so by executing a SQL command. The exact SQL command to delete all BOM table entries in Odoo depends on the version of Odoo you are using and the database backend you are using (e.g., PostgreSQL, MySQL, etc.). It is important to be very careful when executing SQL commands, as they can have unintended consequences. I would recommend consulting with a database administrator or a knowledgeable Odoo developer before proceeding.

In summary, it is not recommended to delete data directly from the database unless you are very familiar with the database structure and you have a backup of the database. If you decide to delete BOM entries, it is recommended to use the "Delete" button in the BOM form view in Odoo. If you still want to delete BOM entries directly from the database, it is recommended to consult with a database administrator or a knowledgeable Odoo developer before proceeding.

Avatar
Discard
Author Best Answer

a reasonable hack i managed to solve problem while learning to walk. Would be greatful if you can help correct / improve where i am wrong. below explanation is for someone in similar situation.

Deleting TABLES data is not solution, weather you try it with cascade or not. with cascade it currupts DB. again depends on if MO had been finished and efficiency reports being generated etc.

-------------------------------------------------------

SOLUTION 1, how to delete data via sql ( can be pgadmin / dbeaver / psql (cmd line postgres tool))

truncate public.mrp_bom restart identity;  >> delete all entries n reset identity

truncate public.mrp_bom cascade; >> this produces long output, all related entries also deleted. very dangerous.

-------------------------------------------------------

SOLUTION 2 (  hack works )

settings app >> developer mode
Technical Setings Menu >> models >> search bom >> go to last bom entry (out of three) and change limit from 80 to 1000.

now do 40 clicks by selecting boms and click delete :)

revert back settings to normal.

---------------------------------------------------------

bonus documentation part.

truly, my intention to delete BOM's were to remove all workcenters (20)  which have finished MO's as well. to do that, actually make sure. no route / workcenter are archived, now

remove MO's, then Routes, deleting workcenters still might not work. to do this. in sql run this

truncate public.mrp_workcenter_productivity cascade;

now you can delete workcenters from UI.;)

truncate public.mrp_workcenter_productivity cascade;

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 21
2997
0
Nov 24
2
0
Mar 23
625
1
Nov 22
2007
1
Oct 22
1236