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

How to delete the stock moves when they are in "done" state?

By
Salt and Light Energy Equipment
on 3/8/13, 2:26 PM 7,133 views

How to delete the stock moves when they are in "done" state?

3

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 3/8/13, 3:21 PM

Short answer - you cannot - for your own good.

This is a fundamental of double entry bookkeeping, every movement has a credit and a debit. It makes it easier to track where your money is going.

It is poor accounting practices to just re-write entries in the ledger. If you made a mistake, make a correcting entry that cancels out the old stock move. Like if you shipped it to a partner in the computer by mistake, create a return with a note that this was just a computer error.

If your database is getting too big, I would see about exporting the information somehow.

0

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 3/8/13, 2:46 PM

OpenERP prevents you from deleting stock moves that are not in the DRAFT state. If a stock move is DONE by mistake (should not have been completed), then you need to create another stock move that is the opposite of the mistake move.

I find it absurd that there is no safe way for the administrator to remove these records. In adjusting the workflow and testing it there are now dozens of test moves I want gone. I guess I have no choice but use SQL to force them all back to draft state so I can safely delete them. Ugly. Why can't the admin have tools for this that normal users will never access?

mike
on 5/24/13, 1:31 PM

100% agree. There are bugs that generate Stock moves that I need to delete but can't. For example, I have a Product set as Make to Stock that is in stock but a Delivery Order has somehow generated a Manufacturing Order and confirmed the stock moves. I need to delete that. I don't need to be protected from this.

Chris Jones
on 10/15/13, 12:22 AM

SQL is the method you can use if you don't want to be protected from the business logic. Make sure you understand exactly what you are doing.

Bista Solutions US, Ray Carnes
on 10/15/13, 2:08 AM
0
mike
On 10/15/13, 11:08 AM
update stock_move set state = 'draft' where id = ?;

Then you can delete them from within OpenERP safely. Or if safety is not a concern...

delete from stock_move where id = ?;

I don't recommend the latter but I've had to do it when a CSV upload test generated several hundred test records and I needed them gone for the next iteration of testing.

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: 3/8/13, 2:26 PM
Seen: 7133 times
Last updated: 4/13/16, 4:50 PM