[6.0] inventory : wrong stocks moves generated when using production lot

Bug #747379 reported by Jacques-Etienne Baudoux
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2
6.0
Fix Released
Medium
OpenERP Publisher's Warranty Team

Bug Description

For each inventory line with a production lot, the generated stock move must be based on the stock level for that (Product,Location,ProdLot) and not (Product,Location)
For example I create an initial inventory:
Location, Product, Qty, Lot#
Stock, FAN, 10, 0000001
Stock, FAN, 10, 0000002
Then, 2 stock moves are generated from Inventory Loss to Stock. That's correct.

I create new inventory:

Location, Product, Qty, Lot#
Stock, FAN, 2, 0000003
Then, 1 stock move is created from Stock to Inventory Loss with qty 13 and Lot# 0000003. This is WRONG.

When fixing this bug, pay attention to this rule: an inventory should NEVER create a stock move for a (Product,Location,ProdLot) that is not present in the inventory

Related bug : https://bugs.launchpad.net/openobject-addons/+bug/747396

Related branches

description: updated
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

This change has been discussed at length with AL, QDP, JBA, please refer to QDP for any question regarding the implementation.

This is part of a global improvement of the handling of production lot numbers in different situations.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
xrg (xrg) wrote : Re: [Bug 747379] [NEW] [6.0] inventory : wrong stocks moves generated when using production lot

On Friday 01 April 2011, you wrote:
> Public bug reported:
> When fixing this bug, pay attention to this rule: an inventory should
> NEVER create a stock move for a (Product,Location,ProdLot) that is not
> present in the inventory

This will always remind me of the fire extinguisher I bought for my car. The
shop used an top-selling commercial ERP (Greek) system.

They had to charge me for a /polishing kit/, because the fire extinguisher,
which they sold me, was not properly 'in stock' at their ERP[1]. They could
only amend that by chosing to move one closely-priced item. #FAIL

Strict rules don't always contribute to database integrity. Sometimes it can
bring exactly the opposite results.

Said that, I agree that at the end of the day there must be a way to verify
that all database sums up to reality (a post validation, say).

[1] It may have been that some typo in their invoice prevented them from
registering the delivery of extinguishers at that day (pending form).

Revision history for this message
qdp (OpenERP) (qdp) wrote :

how to proof it's working:
*create a product RPA
*make a starting inventory in stock with
  - RPA lot 1: 1PCE
  - RPA lot 2: 2PCE
  - RPA lot 3: 3PCE
  - RPA lot 4: 4PCE
*make a second inventory for RPA in stock with
  - RPA lot 1: 2PCE
  - RPA lot 2: 1PCE
  - RPA lot 4: 4PCE
*check that it creates you the following stock moves
  - lot 1: 1PCE from inventory loss to Stock
  - lot 2: -PCE from Stock to inventory loss
  - lot 3: not present
  - lot 4: 0PCE from inventory loss to Stock

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello,
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-747379-rpa with:
revno: 4627
revision-id: <email address hidden>
Thanks for reporting

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for reporting Jacques and thanks for the fix Rucha.

Fix has been applied to stable by revision 4521 <email address hidden>.

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

landed in trunk
revno: 4521
revid:<email address hidden>

Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

oops, the comment above was "landed in 6.0"

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

the fix is also merged in trunk too,

revid: <email address hidden>
revno: 4658

Thanks

Changed in openobject-addons:
status: Fix Committed → Fix Released
milestone: none → 6.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.