Skip to content
Snippets Groups Projects
Commit d0a0b7d9 authored by Guewen Baconnier's avatar Guewen Baconnier Committed by Martin Trigaux
Browse files

[FIX] purchase: skip move if not linked to a purchase order

When this situation happens. the 'cost' is None and the web interface cannot handle this value, provoking a JS error. Thus, prefer to fallback on the standard way to get the cost: based on the current standard price of the product.
Fixes #1032
parent 106cb1ec
No related branches found
No related tags found
No related merge requests found
......@@ -127,7 +127,7 @@ class stock_partial_picking(osv.osv_memory):
# Overridden to inject the purchase price as true 'cost price' when processing
# incoming pickings.
def _product_cost_for_average_update(self, cr, uid, move):
if move.picking_id.purchase_id:
if move.picking_id.purchase_id and move.purchase_line_id:
return {'cost': move.purchase_line_id.price_unit,
'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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment