From 680affe1c4c42bb3c4bc42910159c16ebd62fcab Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Mon, 13 May 2013 09:07:27 +0200 Subject: [PATCH] [fix] using lot cost on do partial --- stock_lot_valuation/stock.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stock_lot_valuation/stock.py b/stock_lot_valuation/stock.py index 980854cb4..ee7586e53 100644 --- a/stock_lot_valuation/stock.py +++ b/stock_lot_valuation/stock.py @@ -257,3 +257,12 @@ class stock_picking(orm.Model): self.compute_price(cr, uid, partial_datas, move, context=context) res = super(stock_picking,self).do_partial(cr, uid, ids, partial_datas, context=context) return res + +class stock_partial_picking(orm.TransientModel): + _inherit = "stock.partial.picking" + + def _product_cost_for_average_update(self, cr, uid, move): + res = super(stock_partial_picking,self)._product_cost_for_average_update(cr, uid, move) + if move.prodlot_id and move.product_id.lot_valuation: + res['cost'] = move.prodlot_id.standard_price + return res