[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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user