From 81f289aad840ae1f4e3c865a06e7cd38ab79101b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 8 Feb 2017 09:54:29 +0100 Subject: [PATCH] Do not call write with no parameters fifo_moves could be empty and so be also to_write but calling write without parameter is not allowed. This was introduced in changeset 8237f9e3afaf issue6196 review33811002 --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index beda2e7ef2..93d9c7bb71 100644 --- a/move.py +++ b/move.py @@ -71,7 +71,8 @@ class Move: to_write.extend(([self.__class__(move.id)], { 'fifo_quantity': new_quantity, })) - self.__class__.write(*to_write) + if to_write: + self.__class__.write(*to_write) if Decimal(str(consumed_qty)) != Decimal("0"): cost_price = cost_price / Decimal(str(consumed_qty))