[FIX] Stock : Check on production lot corrected for move
authorFerdinand @ ChriCar <>
Mon, 24 May 2010 10:39:37 +0000 (16:09 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Mon, 24 May 2010 10:39:37 +0000 (16:09 +0530)
lp bug: https://launchpad.net/bugs/582823 fixed

bzr revid: jvo@tinyerp.com-20100524103937-70fh2gfp58qcslc3

addons/stock/stock.py

index ccb0f5a..c6898e6 100644 (file)
@@ -942,7 +942,7 @@ class stock_move(osv.osv):
 
     def _check_product_lot(self, cr, uid, ids):
         for move in self.browse(cr, uid, ids):
-            if move.prodlot_id and (move.prodlot_id.product_id.id != move.product_id.id):
+            if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id):
                 return False
         return True