From 285bbd8dec76a3a44e9d9a73ad1926cfd10be104 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 27 Jun 2011 12:17:58 +0530 Subject: [PATCH] [IMP]stock:fixed=>1) use historical price in report_stock_move.py instead of product avg price 2)onchange price_unit in move bzr revid: ron@tinyerp.com-20110627064758-ahhhzqhvmho7dq1k --- addons/stock/report/report_stock_move.py | 6 +++--- addons/stock/stock.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index 07289a4379a..faa31e98051 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -94,11 +94,11 @@ class report_stock_move(osv.osv): ELSE 0.0 END AS in_qty, CASE WHEN sp.type in ('out') THEN - sum(sm.product_qty * pu.factor) * pt.standard_price + sum(sm.product_qty * pu.factor) * sm.price_unit ELSE 0.0 END AS out_value, CASE WHEN sp.type in ('in') THEN - sum(sm.product_qty * pu.factor) * pt.standard_price + sum(sm.product_qty * pu.factor) * sm.price_unit ELSE 0.0 END AS in_value, min(sm.id) as sm_id, @@ -133,7 +133,7 @@ class report_stock_move(osv.osv): sm.id,sp.type, sm.date,sm.address_id, sm.product_id,sm.state,sm.product_uom,sm.date_expected, sm.product_id,pt.standard_price, sm.picking_id, sm.product_qty, - sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id) + sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id, sm.price_unit) AS al GROUP BY diff --git a/addons/stock/stock.py b/addons/stock/stock.py index a8b429f4b8b..71be16ec78c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1769,6 +1769,7 @@ class stock_move(osv.osv): 'product_uom': product.uom_id.id, 'product_uos': uos_id, 'product_qty': 1.00, + 'price_unit': product.standard_price, 'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty'] } if not ids: