line: omit calculation of balance if credit/debit = None
remove unused imports
This commit is contained in:
parent
a9773a42df
commit
11d6183d65
8 changed files with 13 additions and 11 deletions
7
line.py
7
line.py
|
@ -733,7 +733,12 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
|
||||
lines = Line2.search(query)
|
||||
for line3 in lines:
|
||||
balance += getattr(line3, credit_name) - getattr(line3, debit_name)
|
||||
line_credit = getattr(line3, credit_name)
|
||||
line_debit = getattr(line3, debit_name)
|
||||
|
||||
if (line_credit is not None) or (line_debit is not None):
|
||||
balance += line_credit - line_debit
|
||||
|
||||
if line3.id == line.id:
|
||||
break
|
||||
return balance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue