Skip to content

Commit

Permalink
[IMP] partner_statement: ref in activity statement lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mariadforgeflow authored and MiquelRForgeFlow committed Feb 20, 2023
1 parent 15b72a1 commit e8d5b7d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions partner_statement/report/activity_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from collections import defaultdict

from odoo import api, models
from odoo import _, api, models


class ActivityStatement(models.AbstractModel):
Expand Down Expand Up @@ -136,6 +136,7 @@ def _get_account_initial_balance(
return balance_start

def _display_lines_sql_q1(self, partners, date_start, date_end, account_type):
payment_ref = _("Payment")
return str(
self._cr.mogrify(
"""
Expand All @@ -148,11 +149,9 @@ def _display_lines_sql_q1(self, partners, date_start, date_end, account_type):
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 ''
THEN %(payment_ref)s
ELSE m.ref
END as case_ref,
l.blocked, l.currency_id, l.company_id,
sum(CASE WHEN (l.currency_id is not null AND l.amount_currency > 0.0)
Expand Down

0 comments on commit e8d5b7d

Please sign in to comment.