Skip to content

Commit

Permalink
fix account_partner_open_items_xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-demeyer committed Jan 16, 2021
1 parent b421106 commit fbe0239
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions account_partner_open_items_xlsx/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2009-2019 Noviat.
# Copyright 2009-2021 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Open Journal Items per partner',
'version': '11.0.1.0.0',
'version': '11.0.1.0.1',
'license': 'AGPL-3',
'author': 'Noviat',
'website': 'http://www.noviat.com',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2009-2019 Noviat
# Copyright 2009-2021 Noviat
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from functools import reduce
Expand Down Expand Up @@ -170,9 +170,18 @@ def _get_ws_params(self, workbook, data, partners):
query_end = (
"WHERE m.company_id = %s " % wiz.company_id.id +
move_selection + account_selection + partner_selection +
"AND "
"((l.full_reconcile_id IS NULL "
" AND COALESCE(pr.amount, 0) < abs(l.balance)) "
"""
AND (
(l.full_reconcile_id IS NULL AND
(pr.id IS NULL
OR CASE WHEN l.id = pr.debit_move_id
THEN (SELECT date FROM account_move_line WHERE id = pr.credit_move_id)
ELSE (SELECT date FROM account_move_line WHERE id = pr.debit_move_id)
END > '{0}'
OR COALESCE(pr.amount, 0) < abs(l.balance)
)
)
""".format(wiz.date_at)
+ reconciled_after + ") "
"AND l.balance != 0 " + where_extra +
"ORDER BY a_code")
Expand Down

0 comments on commit fbe0239

Please sign in to comment.