[FIX] STOCK:Now Invoice Available Products in the Sale Order If It Has Not Available Products
lp bug: https://launchpad.net/bugs/708434 fixed bzr revid: aag@tinyerp.co.in-20110203071144-0xbkqlf7h8ek9a7g
This commit is contained in:
@@ -1166,8 +1166,7 @@ class stock_picking(osv.osv):
|
||||
for move in pick.move_lines:
|
||||
if move.state in ('done', 'cancel'):
|
||||
continue
|
||||
partial_data = partial_datas.get('move%s'%(move.id), False)
|
||||
assert partial_data, _('Missing partial picking data for move #%s') % (move.id)
|
||||
partial_data = partial_datas.get('move%s'%(move.id), {})
|
||||
product_qty = partial_data.get('product_qty',0.0)
|
||||
move_product_qty[move.id] = product_qty
|
||||
product_uom = partial_data.get('product_uom',False)
|
||||
|
||||
@@ -67,8 +67,9 @@ class stock_partial_picking(osv.osv_memory):
|
||||
for m in pick.move_lines:
|
||||
if m.state in ('done', 'cancel'):
|
||||
continue
|
||||
result.append(self.__create_partial_picking_memory(m, pick_type))
|
||||
|
||||
move_memory = self.__create_partial_picking_memory(m, pick_type)
|
||||
if move_memory:
|
||||
result.append(move_memory)
|
||||
if 'product_moves_in' in fields:
|
||||
res.update({'product_moves_in': result})
|
||||
if 'product_moves_out' in fields:
|
||||
@@ -124,12 +125,27 @@ class stock_partial_picking(osv.osv_memory):
|
||||
'prodlot_id' : picking.prodlot_id.id,
|
||||
'move_id' : picking.id,
|
||||
}
|
||||
|
||||
|
||||
if pick_type == 'in':
|
||||
move_memory.update({
|
||||
'cost' : picking.product_id.standard_price,
|
||||
'currency' : picking.product_id.company_id and picking.product_id.company_id.currency_id and picking.product_id.company_id.currency_id.id or False,
|
||||
})
|
||||
|
||||
if pick_type == 'out':
|
||||
type = picking.picking_id.move_type
|
||||
qty_avl = picking.product_id.qty_available
|
||||
if type == 'direct' :
|
||||
if qty_avl <= 0.0 and picking.state != 'assigned':
|
||||
move_memory = {}
|
||||
if picking.product_qty > qty_avl and qty_avl > 0.0:
|
||||
move_memory.update({
|
||||
'quantity' : qty_avl,
|
||||
})
|
||||
if picking.state == 'assigned':
|
||||
move_memory.update({
|
||||
'quantity' : picking.product_qty,
|
||||
})
|
||||
return move_memory
|
||||
|
||||
def do_partial(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user