Skip to content
Extraits de code Groupes Projets
Valider f00468c0 rédigé par jordan's avatar jordan
Parcourir les fichiers

[add] button to download report bordereau with payment from scop_cotisation_report

parent 475f5474
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
from . import controllers from . import controllers
from . import models from . import models
from . import report
from . import wizard from . import wizard
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# Views # Views
"views/account_invoice.xml", "views/account_invoice.xml",
"views/res_config_settings.xml", "views/res_config_settings.xml",
"views/res_partner.xml",
"views/scop_cotisation_cg.xml", "views/scop_cotisation_cg.xml",
"views/scop_cotisation_simulation.xml", "views/scop_cotisation_simulation.xml",
"views/scop_liasse_fiscale.xml", "views/scop_liasse_fiscale.xml",
......
# © 2020 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
# © 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.')
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Copyright 2022 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data>
<record id="scop_contact_view_form" model="ir.ui.view">
<field name="name">res.partner.scop.view.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="cgscop_cotisation.scop_contact_view_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='contribution']/field[@name='contribution_report_ids']/tree" position="inside">
<button name="print_report_with_payment" type="object"
help="Télécharger l'état des paiements" icon="fa-file-pdf-o"
attrs="{'invisible':[('type_contribution_id','!=',%(cgscop_partner.riga_14397)d)]}"/>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter