changeset dd70a5b63cbb in modules/account_stock_continental:default
details: 
https://hg.tryton.org/modules/account_stock_continental?cmd=changeset;node=dd70a5b63cbb
description:
        Do not create moves with a single empty line

        issue9981
        review343351002
diffstat:

 CHANGELOG |  2 ++
 stock.py  |  3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r 3c059ee72bf9 -r dd70a5b63cbb CHANGELOG
--- a/CHANGELOG Sat Dec 19 17:08:44 2020 +0100
+++ b/CHANGELOG Mon Feb 15 14:02:07 2021 +0100
@@ -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 -r 3c059ee72bf9 -r dd70a5b63cbb stock.py
--- a/stock.py  Sat Dec 19 17:08:44 2020 +0100
+++ b/stock.py  Mon Feb 15 14:02:07 2021 +0100
@@ -131,6 +131,9 @@
         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)

Reply via email to