Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • f00468c041f0f0eb3e5409b3ddb2f483f0c683a2
  • 14.0 par défaut
  • 12.0 protégée
  • 13.0
4 résultats

scop_contribution_report.py

Blame
  • scop_contribution_report.py 747 o
    # © 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
    from odoo.exceptions import UserError
    
    
    class ScopContributionReport(models.Model):
        _inherit = "scop.contribution.report"
    
        def print_report_with_payment(self):
            bordereau = self.env['scop.bordereau'].search([
                ('partner_id', '=', self.partner_id.id),
                ('year', '=', self.year),
            ])
            if len(bordereau) == 1:
                return self.env.ref(
                    'cgscop_cotisation_cg.cgscop_bordereau_report_with_payments'
                ).report_action(bordereau)
            else:
                raise UserError('Pas de bordereau rattaché à cette cotisation.')