[FIX] stock: correct production lot tracking

bzr revid: odo@openerp.com-20100903175212-g0ggajd9pruwsloa
This commit is contained in:
Olivier Dony
2010-09-03 19:52:12 +02:00
parent a1f0299cbd
commit 3a8208a76d
+4 -6
View File
@@ -1401,15 +1401,13 @@ class stock_move(osv.osv):
@return: True or False
"""
for move in self.browse(cr, uid, ids):
if move.picking_id and move.picking_id.type=="internal":
return True
if not move.prodlot_id and \
(move.state == 'done' and \
( \
(move.product_id.track_production and move.location_id.usage=='production') or \
(move.product_id.track_production and move.location_dest_id.usage=='production') or \
(move.product_id.track_incoming and move.location_id.usage in ('supplier','internal')) or \
(move.product_id.track_outgoing and move.location_dest_id.usage in ('customer','internal')) \
(move.product_id.track_production and move.location_id.usage == 'production') or \
(move.product_id.track_production and move.location_dest_id.usage == 'production') or \
(move.product_id.track_incoming and move.location_id.usage == 'supplier') or \
(move.product_id.track_outgoing and move.location_dest_id.usage == 'customer') \
)):
return False
return True