[IMP] product: get_history_price multi to ease migration

This method is used only in stock_account that is about to be migrated
into the new API. To ease the migration the method is converted into
a multi method, using a decorator.
This commit is contained in:
Thibault Delavallée
2016-07-12 17:51:28 +02:00
parent 30b2806e58
commit 168807a255
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1218,6 +1218,7 @@ class product_product(osv.osv):
'company_id': company_id,
}, context=context)
@api.cr_uid_ids_context
def get_history_price(self, cr, uid, product_id, company_id, date=None, context=None):
if context is None:
context = {}
@@ -97,7 +97,7 @@ class stock_history(osv.osv):
if line.product_id.cost_method == 'real':
res[line.id] = line.quantity * line.price_unit_on_quant
else:
res[line.id] = line.quantity * product_obj.get_history_price(cr, uid, line.product_id.id, line.company_id.id, date=date, context=context)
res[line.id] = line.quantity * product_obj.get_history_price(cr, uid, [line.product_id.id], line.company_id.id, date=date, context=context)
return res
_columns = {