Comment 3 for bug 870090

Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

It's also on my wishlist. A separate function for average price computation is necessary.

The current computation should also be improved: prices should not be rounded by the currency_obj.compute function. All the decimal precision available is needed in such computation (especially when your currency has no decimal...)

=== modified file 'stock/stock.py'
--- stock/stock.py 2011-11-29 14:23:09 +0000
+++ stock/stock.py 2011-12-06 04:23:09 +0000
@@ -1216,7 +1216,7 @@

                     if qty > 0:
                         new_price = currency_obj.compute(cr, uid, product_currency,
- move_currency_id, product_price)
+ move_currency_id, product_price, False)
                         new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
                                 product.uom_id.id)
                         if product.qty_available <= 0:
@@ -2457,7 +2457,7 @@
                 qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
                 if qty > 0:
                     new_price = currency_obj.compute(cr, uid, product_currency,
- move_currency_id, product_price)
+ move_currency_id, product_price, False)
                     new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
                             product.uom_id.id)
                     if product.qty_available <= 0: