Fix average cost price computation

context locations should be list of ids and not instances

issue3037
review703002
This commit is contained in:
Cédric Krier
2013-03-06 13:08:21 +01:00
parent a81cd74495
commit fd91db0948
+2 -1
View File
@@ -347,9 +347,10 @@ class Move(Workflow, ModelSQL, ModelView):
elif direction == 'out':
quantity = -self.quantity
context = {}
context['locations'] = Location.search([
locations = Location.search([
('type', '=', 'storage'),
])
context['locations'] = [l.id for l in locations]
context['stock_date_end'] = Date.today()
with Transaction().set_context(context):
product = Product(self.product.id)