[IMP]: stock: Improvement in split lot and pack wizard to write move in inventory if wizard is used for inventory
bzr revid: rpa@tinyerp.com-20101124112743-yf96yzwehdlu4qq1
This commit is contained in:
@@ -252,6 +252,8 @@ class split_in_production_lot(osv.osv_memory):
|
||||
}
|
||||
if quantity_rest > 0:
|
||||
current_move = move_obj.copy(cr, uid, move.id, default_val, context=context)
|
||||
if inventory_id and current_move:
|
||||
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, current_move)]}, context=context)
|
||||
new_move.append(current_move)
|
||||
|
||||
if quantity_rest == 0:
|
||||
@@ -274,10 +276,6 @@ class split_in_production_lot(osv.osv_memory):
|
||||
update_val['state'] = move.state
|
||||
move_obj.write(cr, uid, [move.id], update_val)
|
||||
|
||||
if inventory_id and new_move:
|
||||
for m_id in new_move:
|
||||
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, m_id)]}, context=context)
|
||||
|
||||
return new_move
|
||||
|
||||
split_in_production_lot()
|
||||
|
||||
@@ -44,7 +44,6 @@ class stock_split_into(osv.osv_memory):
|
||||
inventory_obj = self.pool.get('stock.inventory')
|
||||
quantity = self.browse(cr, uid, data[0], context).quantity or 0.0
|
||||
for move in move_obj.browse(cr, uid, rec_id):
|
||||
new_move = []
|
||||
quantity_rest = move.product_qty - quantity
|
||||
#if move.tracking_id :
|
||||
# raise osv.except_osv(_('Error!'), _('The current move line is already assigned to a pack, please remove it first if you really want to change it ' \
|
||||
@@ -62,7 +61,6 @@ class stock_split_into(osv.osv_memory):
|
||||
'product_uos': move.product_uom.id,
|
||||
})
|
||||
|
||||
|
||||
if quantity_rest>0:
|
||||
quantity_rest = move.product_qty - quantity
|
||||
tracking_id = track_obj.create(cr, uid, {}, context=context)
|
||||
@@ -77,11 +75,9 @@ class stock_split_into(osv.osv_memory):
|
||||
'product_uos': move.product_uom.id
|
||||
}
|
||||
current_move = move_obj.copy(cr, uid, move.id, default_val, context=context)
|
||||
new_move.append(current_move)
|
||||
if inventory_id and current_move:
|
||||
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, current_move)]}, context=context)
|
||||
|
||||
if inventory_id and new_move:
|
||||
for m_id in new_move:
|
||||
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, m_id)]}, context=context)
|
||||
|
||||
return {}
|
||||
stock_split_into()
|
||||
|
||||
Reference in New Issue
Block a user