From 495318ea48b9a0dcebd4ca2e515cc337810438b3 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Thu, 16 Sep 2010 11:20:17 +0530 Subject: [PATCH] [Fix] sale: remove the purchase_line_id from sale bzr revid: sbh@tinyerp.com-20100916055017-x9gf8agtna3y4i91 --- addons/sale/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 13d9e0f4052..7ce8c806cfb 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -40,8 +40,8 @@ class stock_move(osv.osv): if move.product_id.cost_method != 'average' or not move.price_unit: # no average price costing or cost not specified during picking validation, we will # plug the sale line values if they are found. - if move.purchase_line_id and move.picking_id.pricelist_id.currency_id: - reference_amount, reference_currency_id = move.purchase_line_id.price_unit, move.picking_id.pricelist_id.currency_id.id + if move.sale_line_id and move.picking_id.pricelist_id.currency_id: + reference_amount, reference_currency_id = move.sale_line_id.price_unit, move.picking_id.pricelist_id.currency_id.id return reference_amount, reference_currency_id stock_move()