Skip to Content
Menu
This question has been flagged
5 Replies
4614 Views

My db is now showing a high number of stock moves that need to be deleted.

These moves concern 29 products and each product has 155 identical moves linked to it.

This seems to be the result of trying to make automatic ordering based on stock levels and other suppliers' info.

Each moves needs around 20 seconds to be deleted; which makes the manual deletion a very long work.

The Odoo suport just explained me that there is no technical way to remove these moves.

Does any one encountered the same issue and in case yes how did you solve this?

ps I am not a developper, just a user using a Saas hosted db V8 trying to migrate to V10.

Regards

Avatar
Discard
Best Answer

Hi,

This module will help you in single click to delete/cancel wrong stock moves then auto set balancing inventory.

https://apps.odoo.com/apps/modules/8.0/td_reset_stock_moves/

More detail contact : tidyway.in@gmail.com

Thanks, Rohan

Avatar
Discard
Best Answer

Hi, 

If you have to delete multiple records at time, just switch to the tree view and select the record to delete it by ticking the boolean field in the left side. 


After ticking the required records, click the action menu in the top of the view, then click the delete button. This will delete all the selected records.

Thanks

Avatar
Discard
Author

I know this standard method; it doesn't work for stock moves that are in a "waiting state for another movement" status; I need first to cancel the move; this where it takes around 20 seconds per transaction and I got several hundres to cance. That is why I asked for an advanced way of dealing with such a mess.

Anyway thanks for having answered.

Ok , then you can write a sql query and update the db directly . Or just write a python code for the same and run it.

Author

AS I don't have access to the db thru a sql query (Odoo Saas), what would be the python code process: a button acting on a list of moves? in this case what would be the coding?

Would you please provide me with such coding (I am not a developper)?

something like below?

context = context or {}

for record in self.browse(cr, uid, context.get('active_ids', []), context=context):

value = "waiting for another move"

for val in [state "from stock move model":]

if val:

value += "cancelled" % val

pool.get('product.template').write(cr, uid, record.id, {'state': value[:-1]}, context=context)

Related Posts Replies Views Activity
2
Oct 17
4746
0
Oct 24
108
1
Aug 24
364
3
Jan 24
2893
1
Nov 23
2610