changeset 13e408280657 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=13e408280657
description:
Test for lines to reconcile before showing the next account
issue9458
review317841002
diffstat:
CHANGELOG | 2 ++
move.py | 12 +++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r 6e8bc133e2fb -r 13e408280657 CHANGELOG
--- a/CHANGELOG Fri Jul 24 09:56:22 2020 +0200
+++ b/CHANGELOG Mon Jul 27 16:13:56 2020 +0200
@@ -1,3 +1,5 @@
+* Test for lines to reconcile before showing the next account
+
Version 5.6.0 - 2020-05-04
* Bug fixes (see mercurial logs for details)
* Order account by its code and name
diff -r 6e8bc133e2fb -r 13e408280657 move.py
--- a/move.py Fri Jul 24 09:56:22 2020 +0200
+++ b/move.py Mon Jul 27 16:13:56 2020 +0200
@@ -1593,7 +1593,7 @@
)))
return [a for a, in cursor.fetchall()]
- def get_parties(self, account, _balanced=False):
+ def get_parties(self, account, _balanced=False, party=None):
'Return a list party to reconcile for the account'
pool = Pool()
Line = pool.get('account.move.line')
@@ -1616,9 +1616,12 @@
| Case((account.type.payable, Sum(balance) > 0),
else_=False)
)
+ where = ((line.reconciliation == Null)
+ & (line.account == account.id))
+ if party:
+ where &= (line.party == party.id)
cursor.execute(*line.select(line.party,
- where=(line.reconciliation == Null)
- & (line.account == account.id),
+ where=where,
group_by=line.party,
having=having))
return [p for p, in cursor.fetchall()]
@@ -1724,6 +1727,9 @@
date=self.show.date,
writeoff=self.show.write_off,
description=self.show.description)
+
+ if self.get_parties(self.show.account, party=self.show.party):
+ return 'show'
return 'next_'