From 475f54748c40641b665436135fcae21db9a3a4dc Mon Sep 17 00:00:00 2001 From: benjamin <benjamin@le-filament.com> Date: Wed, 26 Jan 2022 11:48:35 +0100 Subject: [PATCH] [update] delete report contribution inheritance --- __init__.py | 1 - report/__init__.py | 4 --- report/scop_contribution_report.py | 44 ------------------------------ 3 files changed, 49 deletions(-) delete mode 100755 report/__init__.py delete mode 100644 report/scop_contribution_report.py diff --git a/__init__.py b/__init__.py index f88059b..6201253 100755 --- a/__init__.py +++ b/__init__.py @@ -3,5 +3,4 @@ from . import controllers from . import models -from . import report from . import wizard diff --git a/report/__init__.py b/report/__init__.py deleted file mode 100755 index 7b5fa1c..0000000 --- a/report/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# © 2022 Le Filament (<http://www.le-filament.com>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from . import scop_contribution_report diff --git a/report/scop_contribution_report.py b/report/scop_contribution_report.py deleted file mode 100644 index 2fed4b4..0000000 --- a/report/scop_contribution_report.py +++ /dev/null @@ -1,44 +0,0 @@ -# © 2022 Le Filament (<http://www.le-filament.com>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models - - -class ScopContributionReport(models.Model): - _inherit = "scop.contribution.report" - - def _select_invoice(self): - select_str = super(ScopContributionReport, self)._select_invoice() - select_str = """ - SELECT - CAST(i.year AS VARCHAR), - i.type_contribution_id, - i.partner_id, - SUM(i.amount_total_signed) AS amount_called, - SUM(i.amount_total_signed - i.residual_company_signed) AS amount_paid, - SUM(i.residual_company_signed) AS amount_due, - ( - CASE WHEN max(refund.id) IS NOT NULL THEN true ELSE FALSE END OR - CASE WHEN max(refund_b.id) IS NOT NULL THEN true ELSE FALSE END - ) AS is_loss - """ - return select_str - - def _from_invoice(self): - from_str = super(ScopContributionReport, self)._from_invoice() - from_str += """ - LEFT JOIN - scop_bordereau b ON i.bordereau_id = b.id - LEFT JOIN - scop_bordereau refund_b ON b.id = refund_b.refund_id - """ - return from_str - - def _where_invoice(self): - where_str = super(ScopContributionReport, self)._where_invoice() - where_str += "AND (i.bordereau_id IS NULL OR b.is_regul = false OR b.is_regul IS NULL)" - return where_str - - # ------------------------------------------------------ - # Computed fields - # ------------------------------------------------------ -- GitLab