diff --git a/report/scop_contribution_report.py b/report/scop_contribution_report.py index cb32d1092aa29af3dd6253c622fa42f21c34861d..4986c5e16f6248b092e1e4f43e6c58b2ade57efd 100644 --- a/report/scop_contribution_report.py +++ b/report/scop_contribution_report.py @@ -95,3 +95,16 @@ class ScopContributionReport(models.Model): ] domain += add_domain return domain + + def _where_invoice(self): + """ + Hérite la fonction parente pour ne prendre que les factures/avoirs rattachés à + un bordereau pour la CG Scop et toutes pour les autres sociétés + """ + where_str = super()._where_invoice() + where_str += """ + AND ( + (i.company_id = 1 AND i.bordereau_id is not null) OR (i.company_id != 1) + ) + """ + return where_str