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
This commit is contained in:
Cédric Krier
2017-02-08 09:54:29 +01:00
parent 2bfb703f5d
commit 81f289aad8
+2 -1
View File
@@ -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))