Skip to content
Snippets Groups Projects
Commit 83dd7658 authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[update] payment display

parent e5983db8
Branches
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ column_renames = {
"scop_cotisation": [("year", None)],
}
# TODO: migrer lf_note_ref dans ref
@openupgrade.migrate()
def migrate(env, version):
......
......@@ -198,8 +198,7 @@ class ScopContributionReport(models.Model):
payments_html = False
if self.source == "odoo":
invoice_ids = self.get_invoice_contribution()
# TODO: trouver le nouveau champ payment_move_line_ids
payment_ids = invoice_ids.mapped("payment_move_line_ids")
payment_ids = invoice_ids.mapped("move_line_payment_ids")
if payment_ids:
payments = payment_ids.mapped(
lambda p: {
......@@ -230,19 +229,7 @@ class ScopContributionReport(models.Model):
self.env["account.move"]
.sudo()
.search(
[
("year", "=", int(self.year)),
("partner_id", "=", self.partner_id.id),
(
"type_contribution_id",
"=",
self.type_contribution_id.id,
),
("type", "=", "out_invoice"),
"|",
("bordereau_id.state", "not in", ("cancel",)),
("bordereau_id", "=", False),
]
self._get_contribution_domain()
)
)
return invoice_ids
......@@ -281,3 +268,16 @@ class ScopContributionReport(models.Model):
end_html = "</tbody></table>"
return start_html + content_html + end_html
def _get_contribution_domain(self):
return [
("year", "=", int(self.year)),
("partner_id", "=", self.partner_id.id),
(
"type_contribution_id",
"=",
self.type_contribution_id.id,
),
("move_type", "=", "out_invoice"),
("state", "=", "posted"),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment