diff --git a/models/scop_bordereau_cg.py b/models/scop_bordereau_cg.py index 3f627cc3b6803317b196b7171e8d5c1922a8f372..5570ddd535d5da5a26bf6e955d31471d6a414f5b 100644 --- a/models/scop_bordereau_cg.py +++ b/models/scop_bordereau_cg.py @@ -823,16 +823,18 @@ class Bordereau(models.Model): if partner.is_federation_indus: product_fede_indus_id = self.company_id.contribution_fede_indus_id journal_fede_indus_id = self.company_id.journal_fede_indus_id - type_cotisation_fede_indus = self.env.ref("cgscop_partner.cotiz_fede_indus").id + type_cotisation_fede_indus = self.env.ref( + "cgscop_partner.cotiz_fede_indus" + ).id if liasse: amount_fede_indus = base_cotiz.round_to_closest_multiple( liasse.contribution_indus, 4 ) else: - amount_fede_indus = self.env["scop.liasse.fiscale"].get_plancher_cotiz()[ - "fede_indus" - ] + amount_fede_indus = self.env[ + "scop.liasse.fiscale" + ].get_plancher_cotiz()["fede_indus"] self.create_contribution( product=product_fede_indus_id, type_contribution=type_cotisation_fede_indus, @@ -916,10 +918,12 @@ class Bordereau(models.Model): mandate_id = False if mandate_ids: mandate_id = mandate_ids[0] - payment_mode = self.env["account.payment.mode"].search([ - ("payment_method_id.code", "=", "sepa_direct_debit"), - ("company_id", "=", self.env.company.id), - ]) + payment_mode = self.env["account.payment.mode"].search( + [ + ("payment_method_id.code", "=", "sepa_direct_debit"), + ("company_id", "=", self.env.company.id), + ] + ) self.payment_mode_id = payment_mode base_cotiz = self.base_cotisation_cg diff --git a/models/scop_cotisation_cg.py b/models/scop_cotisation_cg.py index 2b6ab5b67474379d645485f0caec157ed1630513..b9fd1eaf4807249cd70d61235ac6bfcaf98b9d79 100644 --- a/models/scop_cotisation_cg.py +++ b/models/scop_cotisation_cg.py @@ -79,13 +79,10 @@ class ScopCotisation(models.Model): graph_values = fields.Text(compute="_compute_graph_values") batch_id = fields.Many2one( - comodel_name="queue.job.batch", - name="Files d'attente en cours" + comodel_name="queue.job.batch", name="Files d'attente en cours" ) batch_ids_str = fields.Char() - batch_count = fields.Integer( - compute="_compute_batch_count" - ) + batch_count = fields.Integer(compute="_compute_batch_count") # ------------------------------------------------------ # Contraintes SQL @@ -304,14 +301,16 @@ class ScopCotisation(models.Model): """ # Vérifie que des tâches ne sont pas en cours self.ensure_one() - queue_ids = self.env["queue.job"].search([ - ("job_batch_id", "in", [int(x) for x in self.batch_ids_str.split(",")]), - ("state", "not in", ["done", "cancelled", "failed"]) - ]) + queue_ids = self.env["queue.job"].search( + [ + ("job_batch_id", "in", [int(x) for x in self.batch_ids_str.split(",")]), + ("state", "not in", ["done", "cancelled", "failed"]), + ] + ) if queue_ids: - raise exceptions.UserError(_( - "Des tâches de création sont encore en cours." - )) + raise exceptions.UserError( + _("Des tâches de création sont encore en cours.") + ) member_to_invoice = self.env["res.partner"].browse(member_ids) # Job queue @@ -332,11 +331,13 @@ class ScopCotisation(models.Model): for member in member_to_invoice: liasse_id = self.get_liasse(member) description = "%s - Adh %s - %s" % ( - self.year, member.member_number, member.name + self.year, + member.member_number, + member.name, ) - self.with_context( - job_batch=batch).with_delay( - max_retries=3, description=description).create_bordereau( + self.with_context(job_batch=batch).with_delay( + max_retries=3, description=description + ).create_bordereau( member=member, liasse=liasse_id, nb_quarter="4", date=False ) batch.enqueue() diff --git a/templates/report_scop_bordereau.xml b/templates/report_scop_bordereau.xml index 0c8a7ed634de268efe95196c3fa4689893152b10..92adfa02c54dc83209b6ece67d45fee26a4a9b9c 100644 --- a/templates/report_scop_bordereau.xml +++ b/templates/report_scop_bordereau.xml @@ -183,9 +183,7 @@ </p> <!-- Paiement par prélèvement --> <t t-if="o.is_sdd"> - <p - style="font-size: 13px; font-weight: bold;" - > + <p style="font-size: 13px; font-weight: bold;"> Référence Unique du Mandat : <t t-esc="o.invoice_ids[0].mandate_id.unique_mandate_reference" @@ -205,7 +203,7 @@ </p> <p class="small"> <em - >IBAN: FR76 4255 9100 0008 0024 8837 710 - BIC : CCOPFRPPXXX</em> + >IBAN: FR76 4255 9100 0008 0024 8837 710 - BIC : CCOPFRPPXXX</em> </p> <p class="small"> Si vous souhaitez régler vos prochaines cotisations par prélèvement, merci de compléter et de nous retourner le document « Mandat de prélèvements SEPA », disponible sur notre site à l'adresse <a diff --git a/views/scop_cotisation_cg.xml b/views/scop_cotisation_cg.xml index bc7947ec78cb9a06259b5f33d9d9196430a52656..dc577199925e54de88cd188100da62d810007494 100644 --- a/views/scop_cotisation_cg.xml +++ b/views/scop_cotisation_cg.xml @@ -63,14 +63,19 @@ </header> <sheet> <div class="oe_button_box" name="contribution_button_box"> - <button name="show_batch" - type="object" - class="oe_stat_button" - icon="fa-list" - attrs="{'invisible': [('batch_count', '=', 0)]}" - > - <field string="Files d'attente" name="batch_count" widget="statinfo" /> - </button> + <button + name="show_batch" + type="object" + class="oe_stat_button" + icon="fa-list" + attrs="{'invisible': [('batch_count', '=', 0)]}" + > + <field + string="Files d'attente" + name="batch_count" + widget="statinfo" + /> + </button> </div> <h1><field name="name" /></h1> <group>