Skip to content

Commit

Permalink
[partner_statement][fix] group by move line id
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Jul 13, 2021
1 parent 6c3d0f8 commit 302613b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions partner_statement/report/outstanding_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _display_lines_sql_q1(self, partners, date_end, account_type):
return str(
self._cr.mogrify(
"""
SELECT m.name AS move_id, l.partner_id, l.date, l.name,
SELECT l.id, m.name AS move_id, l.partner_id, l.date, l.name,
l.blocked, l.currency_id, l.company_id,
CASE WHEN l.ref IS NOT NULL THEN l.ref ELSE m.ref END as ref,
CASE WHEN (l.currency_id is not null AND l.amount_currency > 0.0)
Expand Down Expand Up @@ -83,7 +83,7 @@ def _display_lines_sql_q1(self, partners, date_end, account_type):
(pr.id IS NOT NULL AND pr.max_date <= %(date_end)s) OR
(pr.id IS NULL)
) AND l.date <= %(date_end)s AND m.state IN ('posted')
GROUP BY l.partner_id, m.name, l.date, l.date_maturity, l.name,
GROUP BY l.id, l.partner_id, m.name, l.date, l.date_maturity, l.name,
CASE WHEN l.ref IS NOT NULL THEN l.ref ELSE m.ref END,
l.blocked, l.currency_id, l.balance, l.amount_currency, l.company_id
""",
Expand Down

0 comments on commit 302613b

Please sign in to comment.