[MERGE] stock: fix of return picking wizard
bzr revid: qdp-launchpad@openerp.com-20140124094734-am1el12zuhnoq714
This commit is contained in:
commit
1c90a06813
|
@ -2732,10 +2732,12 @@ class stock_warehouse(osv.osv):
|
|||
'warehouse_id': new_id,
|
||||
'code': 'outgoing',
|
||||
'sequence_id': out_seq_id,
|
||||
'return_picking_type_id': in_type_id,
|
||||
'default_location_src_id': output_loc.id,
|
||||
'default_location_dest_id': customer_loc.id,
|
||||
'sequence': max_sequence + 4,
|
||||
'color': color}, context=context)
|
||||
picking_type_obj.write(cr, uid, [in_type_id], {'return_picking_type_id': out_type_id}, context=context)
|
||||
int_type_id = picking_type_obj.create(cr, uid, vals={
|
||||
'name': _('Internal Transfers'),
|
||||
'warehouse_id': new_id,
|
||||
|
|
|
@ -66,11 +66,11 @@ class stock_return_picking(osv.osv_memory):
|
|||
if pick.state != 'done':
|
||||
raise osv.except_osv(_('Warning!'), _("You may only return pickings that are Done!"))
|
||||
for line in pick.move_lines:
|
||||
qty = line.product_qty
|
||||
qty = line.product_uom_qty
|
||||
if line.returned_move_ids:
|
||||
for returned_move in line.returned_move_ids:
|
||||
if returned_move.product_id.id == line.product_id.id:
|
||||
qty -= returned_move.product_qty
|
||||
qty -= returned_move.product_uom_qty
|
||||
|
||||
if qty > 0:
|
||||
result1.append({'product_id': line.product_id.id, 'quantity': qty, 'move_id': line.id})
|
||||
|
@ -127,7 +127,7 @@ class stock_return_picking(osv.osv_memory):
|
|||
raise osv.except_osv(_('Warning!'), _("Please specify at least one non-zero quantity."))
|
||||
|
||||
pick_obj.action_confirm(cr, uid, [new_picking], context=context)
|
||||
pick_obj.force_assign(cr, uid, [new_picking], context)
|
||||
pick_obj.action_assign(cr, uid, [new_picking], context)
|
||||
return new_picking, pick_type_id
|
||||
|
||||
def create_returns(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue