[FIX] Change remaining qty

bzr revid: jco@openerp.com-20140218091222-so0xw06wy9y400z6
This commit is contained in:
Josse Colpaert 2014-02-18 10:12:22 +01:00
parent f546ce8ad3
commit 95b6ce63eb
2 changed files with 3 additions and 3 deletions

View File

@ -3343,11 +3343,11 @@ class stock_pack_operation(osv.osv):
res = {}
for ops in self.browse(cr, uid, ids, context=context):
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).
#should use _get_remaining_prod_quantities instead
continue
elif ops.product_id:
else:
qty = ops.product_qty
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)

View File

@ -106,7 +106,7 @@
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"
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'):
assert rec.qty == 10, "Should have 10 pieces in customer location from pallet 3"
else: