[FIX] Change remaining qty
bzr revid: jco@openerp.com-20140218091222-so0xw06wy9y400z6
This commit is contained in:
parent
f546ce8ad3
commit
95b6ce63eb
|
@ -3343,11 +3343,11 @@ class stock_pack_operation(osv.osv):
|
||||||
res = {}
|
res = {}
|
||||||
for ops in self.browse(cr, uid, ids, context=context):
|
for ops in self.browse(cr, uid, ids, context=context):
|
||||||
res[ops.id] = 0
|
res[ops.id] = 0
|
||||||
if ops.package_id:
|
if ops.package_id and not ops.product_id:
|
||||||
#dont try to compute the remaining quantity for packages because it's not relevant (a package could include different products).
|
#dont try to compute the remaining quantity for packages because it's not relevant (a package could include different products).
|
||||||
#should use _get_remaining_prod_quantities instead
|
#should use _get_remaining_prod_quantities instead
|
||||||
continue
|
continue
|
||||||
elif ops.product_id:
|
else:
|
||||||
qty = ops.product_qty
|
qty = ops.product_qty
|
||||||
if ops.product_uom_id:
|
if ops.product_uom_id:
|
||||||
qty = uom_obj._compute_qty(cr, uid, ops.product_uom_id.id, ops.product_qty, ops.product_id.uom_id.id)
|
qty = uom_obj._compute_qty(cr, uid, ops.product_uom_id.id, ops.product_qty, ops.product_id.uom_id.id)
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
elif rec.lot_id.name == 'Lot neg' and rec.location_id.id == ref('stock_location_customers'):
|
elif rec.lot_id.name == 'Lot neg' and rec.location_id.id == ref('stock_location_customers'):
|
||||||
assert ((rec.qty == 20 or rec.qty == 120) and not rec.package_id), "Should have 140 pieces (120+20) in customer location from pallet 2 and lot A"
|
assert ((rec.qty == 20 or rec.qty == 120) and not rec.package_id), "Should have 140 pieces (120+20) in customer location from pallet 2 and lot A"
|
||||||
elif rec.package_id.name == 'Palneg 3' and rec.location_id.id == ref('stock_location_stock'):
|
elif rec.package_id.name == 'Palneg 3' and rec.location_id.id == ref('stock_location_stock'):
|
||||||
assert rec.qty == 50, "Should have 30 and 20 pieces in stock on pallet 3"
|
assert rec.qty == 50 or rec.qty == 20 or rec.qty == 30, "Should have 30 and 20 pieces in stock on pallet 3"
|
||||||
elif not rec.package_id and not rec.lot_id and rec.location_id.id == ref('stock_location_customers'):
|
elif not rec.package_id and not rec.lot_id and rec.location_id.id == ref('stock_location_customers'):
|
||||||
assert rec.qty == 10, "Should have 10 pieces in customer location from pallet 3"
|
assert rec.qty == 10, "Should have 10 pieces in customer location from pallet 3"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue