From ff90f2181236868fc8e4e2bf041e7a656e2303ea Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 17 May 2011 14:13:37 +0530 Subject: [PATCH] [FIX]purchase:invoice_line have wrong unit price when PO made =>from picking lp bug: https://launchpad.net/bugs/779064 fixed bzr revid: ron@tinyerp.com-20110517084337-f39957zqveqpa2u4 --- addons/purchase/stock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 541db7331fe..66a7576561f 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -91,7 +91,10 @@ class stock_picking(osv.osv): def _get_price_unit_invoice(self, cursor, user, move_line, type): if move_line.purchase_line_id: - return move_line.purchase_line_id.price_unit + if move_line.purchase_line_id.order_id.invoice_method == 'picking': + return move_line.price_unit + else: + return move_line.purchase_line_id.price_unit return super(stock_picking, self)._get_price_unit_invoice(cursor, user, move_line, type) def _get_discount_invoice(self, cursor, user, move_line):