[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.
This commit is contained in:
Josse Colpaert 2016-01-26 17:04:39 +01:00
parent 1d269d20f2
commit 45d4bd04cb
1 changed files with 4 additions and 0 deletions

View File

@ -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: