From 5f9f8e080e36aa2048ec52328342f00ebd423185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Oct 2013 21:18:46 +0200 Subject: [PATCH] Fix infinite loop when setting internal_quantity There could be difference for Float field between the written value and the read one. This could lead to an infinite loop of write calls, so we also test that it is not already writing the same internal value. issue3332 review1109002 (transplanted from 43b8d3d42033fb6fe5134cee3bc9facb0d351451) --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index 2d9dcad16b..6824a54182 100644 --- a/move.py +++ b/move.py @@ -534,7 +534,8 @@ class Move(Workflow, ModelSQL, ModelView): for move in moves: internal_quantity = cls._get_internal_quantity(move.quantity, move.uom, move.product) - if internal_quantity != move.internal_quantity: + if (internal_quantity != move.internal_quantity + and internal_quantity != vals.get('internal_quantity')): cls.write([move], { 'internal_quantity': internal_quantity, })