The Environment

  • OpenERP 6.0.2
  • OpenERP GTK Client for Windows 6.0.2

The Symptom

  • Adjustments to Stock Quantity for a product result in dramatically inaccurate quantities in Real Stock and Virtual Stock

The Problem

(in this case there are two)

  • Erroneous Virtual Stock counts are generated by Procurement associated with canceled Purchase Orders
  • Erroneous Virtual Stock resulting from duplicate internal stock moves triggered by Receiving

The Cause

(Problem: Erroneous Virtual Stock counts are generated by Procurement associated with canceled Purchase orders)

This is a problem with automatic procurement. When the scheduler runs and generates a Procurement Order triggered by minimum stock rules, OpenERP adds the quantity from the Procurement Order to Virtual Stock immediately, without waiting for the draft RFQ to be converted to a Purchase Order. This is, unfortunately, not a bug, but a designed feature of OpenERP. Feature is overstating it. It is handled this way to stop the scheduler from generating another procurement order for the same stock when there’s already one in the pipeline.

This “solution” has several undesirable side effects:

  1. Virtual Stock counts include items that have not been ordered.
  2. Virtual Stock counts include procurement orders in exception state.
  3. Cancelling the corresponding RFQ or Purchase Order does not change Virtual Stock. Counts continue to reflect quantities that have not been ordered.
  4. Every time the scheduler runs, it generates a new Procurement Order for any product with previous Procurements in Exception state.

The Cause

(Problem: Erroneous Virtual Stock resulting from duplicate internal stock moves triggered by Procurement and Purchase Order

We’re not exactly sure what is causing this problem yet. Incoming shipments move from the Supplier location to Receiving. We have Push flows set up on Products to move them automatically from Receiving to the Warehouse bin location when receiving is validated. For some products, something in the ordering or receiving process is generating dozens to hundreds of draft stock moves from Receiving to the warehouse bin location. When receiving is processed, the first move completes appropriately. The others remain in Waiting state. The duplicate stock moves in Waiting state impact Virtual Stock for both the bin location and for Receiving.

Generally, Real Stock and Virtual Stock on the product will appear to be accurate as the negative Virtual Stock in Receiving cancels out the excess Virtual Stock in the bin location. Inventory adjustments to stock in the bin location produce really interesting results, with both Real Stock and Virtual Stock suddenly showing large negative quantities.

The Solution

Addressed in a series of separate posts, with screen shots. I’ll update this section as I publish those pages.

  1. Short Form Procedure for correcting Virtual Stock: Cleaning up after Automatic Procurement in OpenERP

References