changeset 9c5a7875ae35 in modules/account:5.0
details: https://hg.tryton.org/modules/account?cmd=changeset;node=9c5a7875ae35
description:
        Test account is set before reading it's company

        account is empty on reconciliation without lines

        issue9684
        review322221002
        (grafted from 72bfbca78289804ed72be1d293436501abfd0054)
diffstat:

 move.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 7789e49630da -r 9c5a7875ae35 move.py
--- a/move.py   Sun Aug 02 17:50:48 2020 +0200
+++ b/move.py   Fri Oct 09 21:42:41 2020 +0200
@@ -533,7 +533,8 @@
                             'party1': line.party.rec_name,
                             'party2': party.rec_name,
                             })
-            if not account.company.currency.is_zero(debit - credit):
+            if (account
+                    and not account.company.currency.is_zero(debit - credit)):
                 lang = Lang.get()
                 debit = lang.currency(debit, account.company.currency)
                 credit = lang.currency(credit, account.company.currency)

Reply via email to