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

scop_bordereau_update_confirm.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.')