diff --git a/addons/stock/test/inventory.yml b/addons/stock/test/inventory.yml index f36aab303d3..6afc7e9d4ba 100644 --- a/addons/stock/test/inventory.yml +++ b/addons/stock/test/inventory.yml @@ -53,17 +53,17 @@ - !python {model: product.product}: | context['location'] = ref('stock.stock_location_14') - product = self.browse(cr, uid, ref('product.product_product_3'), context=context) + product = self.browse(cr, uid, ref('inventory_product'), context=context) assert product.qty_available == 10, 'Expecting 10 products, got %.2f on location stock_location_14!' % (product.qty_available,) context['location'] = ref('stock.stock_location_stock') - product = self.browse(cr, uid, ref('product.product_product_3'), context=context) + product = self.browse(cr, uid, ref('inventory_product'), context=context) assert product.qty_available == 10, 'Expecting 10 products, got %.2f on location stock_location_stock!' % (product.qty_available,) - I check that the quantity on hand is 0 on a brother location - !python {model: product.product}: | context['location'] = ref('stock.stock_location_components') - product = self.browse(cr, uid, ref('product.product_product_3'), context=context) + product = self.browse(cr, uid, ref('inventory_product'), context=context) assert product.qty_available == 0, 'Expecting 0 products, got %.2f on location stock_location_components!' % (product.qty_available,) - I create another inventory @@ -82,7 +82,7 @@ - !python {model: stock.inventory}: | inv = self.browse(cr, uid, ref('inventory_test1'), context=context) - assert len(inv.line_ids) == 1, "Wrong number of inventory lines." + assert inv.line_ids and len(inv.line_ids) == 1, "Wrong number of inventory lines." assert len(inv.line_ids[0].product_qty) == 10, "Wrong quantity in inventory line." assert len(inv.line_ids[0].product_id.id) == ref('inventory_product'), "Wrong product in inventory line." -