From fd91db0948ef6f4f71f2849cf8a88dbfb63b04f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 6 Mar 2013 13:08:21 +0100 Subject: [PATCH] Fix average cost price computation context locations should be list of ids and not instances issue3037 review703002 --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index 3deb5ffb05..a87c7d2cb4 100644 --- a/move.py +++ b/move.py @@ -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)