Skip to content
Snippets Groups Projects
Commit 6f997646 authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] product: get_history_price recieves ids instead of a browse record for product template

bzr revid: mat@openerp.com-20140509073315-9q0igp9zh6d96bl6
parent c43cbe8d
Branches
Tags
No related merge requests found
......@@ -405,7 +405,7 @@ class product_template(osv.osv):
if date is None:
date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
price_history_obj = self.pool.get('product.price.history')
history_ids = price_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product_tmpl.id), ('datetime', '<=', date)], limit=1)
history_ids = price_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product_tmpl), ('datetime', '<=', date)], limit=1)
if history_ids:
return price_history_obj.read(cr, uid, history_ids[0], ['cost'], context=context)['cost']
return 0.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment