[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

@@ -79,29 +79,32 @@ class ActivityStatement(models.AbstractModel):
self._cr.mogrify(
"""
SELECT m.name AS move_id, l.partner_id, l.date,
CASE WHEN (aj.type IN ('sale', 'purchase'))
THEN l.name
ELSE '/'
END as name,
CASE WHEN (aj.type IN ('sale', 'purchase'))
THEN l.ref
WHEN (aj.type in ('bank', 'cash'))
THEN 'Payment'
ELSE ''
END as ref,
l.blocked, l.currency_id, l.company_id,
CASE WHEN (l.currency_id is not null AND l.amount_currency > 0.0)
THEN sum(l.amount_currency)
ELSE sum(l.debit)
END as debit,
CASE WHEN (l.currency_id is not null AND l.amount_currency < 0.0)
THEN sum(l.amount_currency * (-1))
ELSE sum(l.credit)
END as credit,
CASE WHEN l.date_maturity is null
THEN l.date
ELSE l.date_maturity
END as date_maturity
CASE WHEN (aj.type IN ('sale', 'purchase'))
THEN l.name
ELSE '/'
END as name,
CASE
WHEN (aj.type IN ('sale', 'purchase')) AND l.name IS NOT NULL
THEN l.ref
WHEN aj.type IN ('sale', 'purchase') AND l.name IS NULL
THEN m.ref
WHEN (aj.type in ('bank', 'cash'))
THEN 'Payment'
ELSE ''
END as ref,
l.blocked, l.currency_id, l.company_id,
CASE WHEN (l.currency_id is not null AND l.amount_currency > 0.0)
THEN sum(l.amount_currency)
ELSE sum(l.debit)
END as debit,
CASE WHEN (l.currency_id is not null AND l.amount_currency < 0.0)
THEN sum(l.amount_currency * (-1))
ELSE sum(l.credit)
END as credit,
CASE WHEN l.date_maturity is null
THEN l.date
ELSE l.date_maturity
END as date_maturity
FROM account_move_line l
JOIN account_move m ON (l.move_id = m.id)
JOIN account_journal aj ON (l.journal_id = aj.id)
@@ -115,10 +118,13 @@ class ActivityStatement(models.AbstractModel):
THEN l.name
ELSE '/'
END,
CASE WHEN (aj.type IN ('sale', 'purchase'))
THEN l.ref
WHEN (aj.type in ('bank', 'cash'))
THEN 'Payment'
CASE
WHEN (aj.type IN ('sale', 'purchase')) AND l.name IS NOT NULL
THEN l.ref
WHEN aj.type IN ('sale', 'purchase') AND l.name IS NULL
THEN m.ref
WHEN (aj.type in ('bank', 'cash'))
THEN 'Payment'
ELSE ''
END,
l.blocked, l.currency_id, l.amount_currency, l.company_id