diff --git a/models/scop_cotisation_cg_exo.py b/models/scop_cotisation_cg_exo.py index 04d8ad5a2ad39a5981bb755a41c5b7f3ca421cb3..c30977491755353550f05d72ec03c5e94679ded5 100644 --- a/models/scop_cotisation_cg_exo.py +++ b/models/scop_cotisation_cg_exo.py @@ -389,6 +389,7 @@ class ScopCotisationExo(models.Model): raise UserError("Erreur, le type d'exonération n'est pas configuré") if exo_amount != 0: + date_refund = bordereau_id.date_cotisation if bordereau_id.state == 'draft' else self.date_exo_ok # Create refund member_refund = bordereau_id.invoice_ids.create({ 'partner_id': bordereau_id.partner_id.id, @@ -401,11 +402,12 @@ class ScopCotisationExo(models.Model): 'state': 'draft', 'account_id': inv_id.account_id.id, 'payment_mode_id': bordereau_id.payment_mode_id.id, - 'date_invoice': self.date_exo_ok, + 'date_invoice': date_refund, 'date_due': self.date_exo_ok, 'bordereau_id': bordereau_id.id, 'cotiz_quarter': quarter, - 'refund_invoice_id': inv_id.id + 'refund_invoice_id': inv_id.id, + 'name': 'Exonération ' + self.number }) member_refund.invoice_line_ids.create({ 'invoice_id': member_refund.id,