Kirti Savalia(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-904029-ksa into 
lp:openobject-addons.

Requested reviews:
  Rucha (Open ERP) (rpa-openerp)
Related bugs:
  Bug #904029 in OpenERP Addons: "average price wrong value in stock move"
  https://bugs.launchpad.net/openobject-addons/+bug/904029

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-904029-ksa/+merge/86945
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-904029-ksa/+merge/86945
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-904029-ksa.
=== modified file 'purchase/stock.py'
--- purchase/stock.py	2011-12-19 16:54:40 +0000
+++ purchase/stock.py	2011-12-27 12:43:25 +0000
@@ -127,7 +127,7 @@
     # incoming pickings.
     def _product_cost_for_average_update(self, cr, uid, move):
         if move.picking_id.purchase_id:
-            return {'cost': move.purchase_line_id.price_unit,
+            return {'cost': move.price_unit or move.purchase_line_id.price_unit or move.product_id.standard_price,
                     'currency': move.picking_id.purchase_id.pricelist_id.currency_id.id}
         return super(stock_partial_picking, self)._product_cost_for_average_update(cr, uid, move)
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to