Skip to content
Extraits de code Groupes Projets
Valider 179f843d rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[update] function update_bordereau_version if contribution CG is not in previous version

parent e543edcc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -1038,6 +1038,7 @@ class Bordereau(models.Model):
# CREATE REGUL
ur_hdf = self.env.ref("cgscop_partner.riga_14232").id
ur_med = self.env.ref("cgscop_partner.riga_14243").id
type_cotisation_cg = self.env.ref("cgscop_partner.riga_14397").id
type_cotisation_ur = self.env.ref("cgscop_partner.riga_14399").id
type_cotisation_fede_com = self.env.ref("cgscop_partner.riga_14398").id
type_cotisation_fede_cae = self.env.ref("cgscop_partner.cotiz_fede_cae").id
......@@ -1051,6 +1052,13 @@ class Bordereau(models.Model):
contrib_type = list(map(lambda c: c.get("type_contribution_id")[0], contribs))
# Vérifie et ajoute les cotisations manquantes si nécessaire
if type_cotisation_cg not in contrib_type:
contribs.append(
{
"type_contribution_id": (type_cotisation_cg,),
"amount_total_signed": 0,
}
)
if (
partner_id.ur_id.id in (ur_med, ur_hdf)
and type_cotisation_ur not in contrib_type
......
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