From 45d4bd04cb5152e20f6e4c63aaefa240ed7104b9 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 26 Jan 2016 17:04:39 +0100 Subject: [PATCH] [FIX] purchase: the stock should be valued without the taxes included from the purchase order line From issue 660592. (already fixed in v9) When products are received from a purchase line with taxes included, the cost for the stock valuation (on the stock move) on reception should be without these taxes included. --- addons/purchase/purchase.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 8413cbfe702..e55d9ff98df 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -747,6 +747,10 @@ class purchase_order(osv.osv): ''' prepare the stock move data from the PO line. This function returns a list of dictionary ready to be used in stock.move's create()''' product_uom = self.pool.get('product.uom') price_unit = order_line.price_unit + if order_line.taxes_id: + taxes = self.pool['account.tax'].compute_all(cr, uid, order_line.taxes_id, price_unit, 1.0, + order_line.product_id, order.partner_id) + price_unit = taxes['total'] if order_line.product_uom.id != order_line.product_id.uom_id.id: price_unit *= order_line.product_uom.factor / order_line.product_id.uom_id.factor if order.currency_id.id != order.company_id.currency_id.id: