average price wrong value in stock move

Bug #904029 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP R&D Addons Team 2

Bug Description

stock_partial_picking.py

def _product_cost_for_average_update

it is not possible to calculate a new avg price using the product_id.standard_price !
'cost': move.product_id.standard_price,

it is necessary to take the (new) price from partial picking or if empty from purchase line

the standard price can only be used for valuation of production

Related branches

Revision history for this message
Ferdinand (office-chricar) wrote :

had to use
 res.update({'cost' : move.price_unit or move.purchase_line_id.price_unit or move.product_id.standard_price })
to get correct behaviour

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

I agree with DR Ferdinand, at there is should be take the values form the purchase order line not form the product's standard cost.

I have not reproduce it, but regarding code code improvement I am confirming this issue.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,

Thanks For Reporting.
It has been Fixed in http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-904029-ksa/
revision-id: <email address hidden>
revno: 6167
It will be available in trunk soon.

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello Ferdinand,

can you shrare your views when average price value wrong in stock move.Because it has to be clear on which cost we take, and not one of the three.
so please give more reference about this.

Thanks.

Revision history for this message
Ferdinand (office-chricar) wrote :

Well this seems clear to me
 res.update({'cost' : move.price_unit or move.purchase_line_id.price_unit or move.product_id.standard_price })

if we have already a price_unit in the move(line) we must take it
else we take the price_unit from the purchase line - which will be normally evailable
the move.product_id.standard_price is only here as fall back

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.