diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 1bd499b0eda..36c665c6cbb 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3517,12 +3517,12 @@ class stock_pack_operation(osv.osv): if not qty > 0: break if ops.package_id: - bool = quant.package_id and bool(package_obj.search(cr, uid, [('id', 'child_of', [ops.package_id.id]), ('id', '=', quant.package_id.id)], context=context)) or False + flag = quant.package_id and bool(package_obj.search(cr, uid, [('id', 'child_of', [ops.package_id.id]), ('id', '=', quant.package_id.id)], context=context)) or False else: - bool = not quant.package_id.id - bool = bool and ((ops.lot_id and ops.lot_id.id == quant.lot_id.id) or not ops.lot_id) - bool = bool and (ops.owner_id.id == quant.owner_id.id) - if bool: + flag = not quant.package_id.id + flag = flag and ((ops.lot_id and ops.lot_id.id == quant.lot_id.id) or not ops.lot_id) + flag = flag and (ops.owner_id.id == quant.owner_id.id) + if flag: quant_qty = quant.qty if quants_done.get(quant.id): if quants_done[quant.id] == 0: diff --git a/addons/stock/test/packing.yml b/addons/stock/test/packing.yml index 7bd9a3870ac..ac610112c80 100644 --- a/addons/stock/test/packing.yml +++ b/addons/stock/test/packing.yml @@ -139,11 +139,11 @@ backorder_ids = self.search(cr, uid, [('backorder_id', '=', ref('delivery_order1'))], context=context) assert backorder_ids, "Backorder should have been created" self.do_prepare_partial(cr, uid, backorder_ids, context=context) - picking = self.browse(cr, uid backorder_ids[0]) + picking = self.browse(cr, uid, backorder_ids[0]) assert len(picking.pack_operation_ids) == 2, "Wrong number of pack operation" - assert picking.pack_operation_ids[0].produc_qty == 100, "Wrong quantity in pack operation" + assert picking.pack_operation_ids[0].product_qty == 100, "Wrong quantity in pack operation" assert picking.pack_operation_ids[0].package_id.name == 'Pallet 2', "Wrong pallet in pack operation" - assert picking.pack_operation_ids[1].produc_qty == 50, "Wrong quantity in pack operation" + assert picking.pack_operation_ids[1].product_qty == 50, "Wrong quantity in pack operation" assert picking.pack_operation_ids[1].package_id.name == 'Pallet 3', "Wrong pallet in pack operation" self.action_assign(cr, uid, backorder_ids, context=context) self.do_transfer(cr, uid, backorder_ids, context=context)