[FIX] availability of prodlot check when assigning a prodlot to a move: non optimal location_id control
lp bug: https://launchpad.net/bugs/338329 fixed bzr revid: christophe@tinyerp.com-20090609153728-avsw10uatlyzegub
This commit is contained in:
parent
3303c43d7d
commit
505502dd31
|
@ -981,10 +981,12 @@ class stock_move(osv.osv):
|
|||
ON stock_move (location_id, location_dest_id, product_id, state)')
|
||||
cursor.commit()
|
||||
|
||||
def onchange_lot_id(self, cr, uid, context, prodlot_id=False,product_qty=False, loc_id=False):
|
||||
def onchange_lot_id(self, cr, uid, context=None, prodlot_id=False, product_qty=False, loc_id=False):
|
||||
if not prodlot_id or not loc_id:
|
||||
return {}
|
||||
prodlot = self.pool.get('stock.production.lot').browse(cr, uid, prodlot_id)
|
||||
ctx = context and context.copy() or {}
|
||||
ctx['location_id'] = loc_id
|
||||
prodlot = self.pool.get('stock.production.lot').browse(cr, uid, prodlot_id, ctx)
|
||||
location=self.pool.get('stock.location').browse(cr,uid,loc_id)
|
||||
warning={}
|
||||
if (location.usage == 'internal') and (product_qty > (prodlot.stock_available or 0.0)):
|
||||
|
|
Loading…
Reference in New Issue