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

bzr revid: mat@openerp.com-20140509073315-9q0igp9zh6d96bl6
This commit is contained in:
Martin Trigaux 2014-05-09 09:33:15 +02:00
parent c43cbe8d72
commit 6f99764697
1 changed files with 1 additions and 1 deletions

View File

@ -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