diff --git a/CHANGELOG b/CHANGELOG index 1eed7164b9..2f5a3a43e2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Do not create moves with a single empty line + Version 5.8.0 - 2020-11-02 * Bug fixes (see mercurial logs for details) * Remove support for Python 3.5 diff --git a/stock.py b/stock.py index 601075d8eb..949be35e9b 100644 --- a/stock.py +++ b/stock.py @@ -131,6 +131,9 @@ class Move(metaclass=PoolMeta): amount = Decimal('0.0') for line in account_move_lines: amount += line.debit - line.credit + + if not amount: + return move_line = self._get_account_stock_move_line(amount) if move_line: account_move_lines.append(move_line)