Browse Source

Merge PR #804 into 13.0

Signed-off-by JordiBForgeFlow
13.0-ocabot-merge-pr-804-by-JordiBForgeFlow-bump-patch
OCA-git-bot 3 years ago
parent
commit
6986c754c2
  1. 4
      partner_statement/report/outstanding_statement.py

4
partner_statement/report/outstanding_statement.py

@ -16,7 +16,7 @@ class OutstandingStatement(models.AbstractModel):
return str( return str(
self._cr.mogrify( 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, 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.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) CASE WHEN (l.currency_id is not null AND l.amount_currency > 0.0)
@ -83,7 +83,7 @@ class OutstandingStatement(models.AbstractModel):
(pr.id IS NOT NULL AND pr.max_date <= %(date_end)s) OR (pr.id IS NOT NULL AND pr.max_date <= %(date_end)s) OR
(pr.id IS NULL) (pr.id IS NULL)
) AND l.date <= %(date_end)s AND m.state IN ('posted') ) 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, 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 l.blocked, l.currency_id, l.balance, l.amount_currency, l.company_id
""", """,

Loading…
Cancel
Save