[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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user