Do not create moves with a single empty line

issue9981
review343351002
This commit is contained in:
Sergi Almacellas Abellana committed 2021-02-15 14:02:07 +01:00
1 parent ddcfd1ad57
commit fed6089997
2 files changed
+5

No files matched your search

+2
View File
@@ -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
+3
View File
@@ -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)