Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
F
financial_contract_guarantee
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
financial_tools
financial_contract_guarantee
Validations
0d7ddfbb
Valider
0d7ddfbb
rédigé
Il y a 3 mois
par
Hugo Trentesaux
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
add computed fields
parent
032fc447
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
models/financial_contract_guarantee.py
+41
-10
41 ajouts, 10 suppressions
models/financial_contract_guarantee.py
views/financial_contract_guarantee.xml
+20
-4
20 ajouts, 4 suppressions
views/financial_contract_guarantee.xml
avec
61 ajouts
et
14 suppressions
models/financial_contract_guarantee.py
+
41
−
10
Voir le fichier @
0d7ddfbb
...
...
@@ -143,6 +143,12 @@ class FinancialContractGuarantee(models.Model):
# --- Loan Data ---
payment_date
=
fields
.
Date
(
"
Date de versement
"
)
payment_date_computed
=
fields
.
Date
(
string
=
"
Date de paiement mise à jour
"
,
help
=
"
Calculée sur la dernière valeur connue dans les lignes CRESERFI
"
,
store
=
True
,
compute
=
"
_compute_guarantee_data
"
,
)
amount_initial
=
fields
.
Monetary
(
string
=
"
Montant initial
"
,
compute
=
"
_compute_amount_initial
"
,
...
...
@@ -150,16 +156,30 @@ class FinancialContractGuarantee(models.Model):
readonly
=
False
,
)
amount_received
=
fields
.
Monetary
(
"
Montant reçu
"
)
# if loan expiration date is updated, this field is set to a value
# which should be higher than expiration_date (from financial contract)
expiration_date_amended
=
fields
.
Date
(
"
Date de fin de prêt mise à jour
"
)
remaining_capital
=
fields
.
Monetary
(
"
Capital restant dû
"
,
tracking
=
1
)
expiration_date_computed
=
fields
.
Date
(
string
=
"
Date d
'
expiration mise à jour
"
,
help
=
"
Calculée sur la dernière valeur connue dans les lignes CRESERFI
"
,
store
=
True
,
compute
=
"
_compute_guarantee_data
"
,
)
remaining_capital
=
fields
.
Monetary
(
"
Capital restant dû
"
,
tracking
=
1
,
store
=
True
,
compute
=
"
_compute_guarantee_data
"
,
)
loan_duration
=
fields
.
Integer
(
string
=
"
Durée du crédit (mois)
"
,
compute
=
"
_compute_loan_duration
"
,
store
=
True
,
readonly
=
False
,
)
loan_duration_computed
=
fields
.
Integer
(
string
=
"
Durée du crédit (mois) mise à jour
"
,
help
=
"
Calculée sur la dernière valeur connue dans les lignes CRESERFI
"
,
store
=
True
,
compute
=
"
_compute_guarantee_data
"
,
)
# --- Company Data ---
segment_code
=
fields
.
Char
(
"
Code Segment
"
)
...
...
@@ -204,6 +224,11 @@ class FinancialContractGuarantee(models.Model):
@api.depends
(
"
line_ids
"
,
"
line_ids.bdf_scoring
"
,
"
line_ids.end_date
"
,
"
line_ids.payment_date
"
,
"
line_ids.loan_duration
"
,
"
line_ids.remaining_capital
"
,
"
line_ids.amount_received
"
,
)
def
_compute_guarantee_data
(
self
):
for
guarantee
in
self
:
...
...
@@ -211,12 +236,18 @@ class FinancialContractGuarantee(models.Model):
ordered
=
with_date
.
sorted
(
"
line_date
"
,
reverse
=
True
)
if
ordered
:
last_line
=
ordered
[
0
]
guarantee
.
update
({
"
bdf_scoring
"
:
last_line
.
bdf_scoring
})
@api.depends
(
"
line_ids
"
,
"
line_ids.commission_amount
"
,
guarantee
.
update
(
{
"
bdf_scoring
"
:
last_line
.
bdf_scoring
,
"
expiration_date_computed
"
:
last_line
.
end_date
,
"
payment_date_computed
"
:
last_line
.
payment_date
,
"
loan_duration_computed
"
:
last_line
.
loan_duration
,
"
remaining_capital
"
:
last_line
.
remaining_capital
,
"
amount_received
"
:
last_line
.
amount_received
,
}
)
@api.depends
(
"
line_ids
"
,
"
line_ids.commission_amount
"
)
def
_compute_commission_amount
(
self
):
for
guarantee
in
self
:
guarantee
.
commission_amount
=
sum
(
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
views/financial_contract_guarantee.xml
+
20
−
4
Voir le fichier @
0d7ddfbb
...
...
@@ -72,11 +72,15 @@
name=
"action_set_social_share_amount"
type=
"object"
invisible=
"social_share_amount == social_share_amount_computed"
title=
"Appliquer le montant calculé aux parts sociales"
>
<i
class=
"fa fa-gear"
role=
"img"
/>
Appliquer le montant calculé
Appliquer le montant calculé de
<field
name=
"social_share_amount_computed"
class=
"oe_inline"
/>
</button>
<field
name=
"social_share_amount"
readonly=
"1"
/>
<field
name=
"social_share_amount"
/>
<field
name=
"social_share_number"
/>
<field
name=
"is_counter_guarantee"
/>
...
...
@@ -97,11 +101,23 @@
<group
name=
"loan"
string=
"Prêt"
>
<field
name=
"external_loan_id"
options=
"{'no_create': 1}"
/>
<field
name=
"payment_date"
/>
<!-- only show computed payment date when it is defined and different from known value -->
<field
name=
"payment_date_computed"
invisible=
"not payment_date_computed or payment_date_computed == payment_date"
/>
<field
name=
"amount_initial"
/>
<field
name=
"expiration_date"
/>
<!-- only show computed expiration date when it is defined and different from known value -->
<field
name=
"expiration_date_computed"
invisible=
"not expiration_date_computed or expiration_date_computed == expiration_date"
/>
<field
name=
"loan_duration"
/>
<!-- only show computed loan duration when it is defined and different from known value -->
<field
name=
"
expiration_date_amend
ed"
invisible=
"not
expiration_date_amended
"
name=
"
loan_duration_comput
ed"
invisible=
"not
loan_duration_computed or loan_duration_computed == loan_duration
"
/>
<field
name=
"amount_received"
/>
<field
name=
"remaining_capital"
/>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter