[13.0][IMP] partner_statement:

* show partner name at the top.
* simplify view logic for `name` and `ref` printing.
* fallback to journal entry `ref` when the journal item has no
  `ref` set.
* little query formatting changes to enhance readability.

[UPD] Update partner_statement.pot

[UPD] README.rst

partner_statement 13.0.1.1.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-financial-reporting-13.0/account-financial-reporting-13.0-partner_statement
Translate-URL: https://translation.odoo-community.org/projects/account-financial-reporting-13-0/account-financial-reporting-13-0-partner_statement/
This commit is contained in:
Lois Rilo
2020-11-17 17:22:48 +01:00
committed by Miquel Raïch
parent d6bc0eb9f1
commit 55ba69fd29
21 changed files with 190 additions and 138 deletions

View File

@@ -17,7 +17,11 @@ class OutstandingStatement(models.AbstractModel):
self._cr.mogrify(
"""
SELECT m.name AS move_id, l.partner_id, l.date, l.name,
l.ref, 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.currency_id is not null AND l.amount_currency > 0.0)
THEN avg(l.amount_currency)
ELSE avg(l.debit)
@@ -62,8 +66,11 @@ class OutstandingStatement(models.AbstractModel):
(pd.id IS NULL AND pc.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,
l.ref, l.blocked, l.currency_id,
l.balance, l.amount_currency, l.company_id
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
""",
locals(),
),