Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
T
training_survey
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
training
training_survey
Validations
bcba3b8f
Valider
bcba3b8f
rédigé
Il y a 10 mois
par
Julien - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Revert "[WIP] tentative de pre inscription"
parent
317a5bc2
Branches
14-RV-20250129
Branches contenant la validation
Aucune étiquette associée trouvée
1 requête de fusion
!1
Revert "[WIP] tentative de pre inscription"
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
models/survey_user_input.py
+1
-43
1 ajout, 43 suppressions
models/survey_user_input.py
avec
1 ajout
et
43 suppressions
models/survey_user_input.py
+
1
−
43
Voir le fichier @
bcba3b8f
# Copyright 2019-2022 Le Filament (<https://le-filament.com>)
# Copyright 2019-2022 Le Filament (<https://le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from
odoo
import
fields
,
models
,
api
from
odoo
import
fields
,
models
class
SurveyUserInput
(
models
.
Model
):
class
SurveyUserInput
(
models
.
Model
):
...
@@ -16,9 +16,7 @@ class SurveyUserInput(models.Model):
...
@@ -16,9 +16,7 @@ class SurveyUserInput(models.Model):
comodel_name
=
"
training.training
"
,
comodel_name
=
"
training.training
"
,
string
=
"
Formation
"
,
string
=
"
Formation
"
,
ondelete
=
"
cascade
"
,
ondelete
=
"
cascade
"
,
compute
=
"
_compute_training_id
"
)
)
training_survey_type
=
fields
.
Selection
(
training_survey_type
=
fields
.
Selection
(
string
=
"
Type de questionnaire formation
"
,
string
=
"
Type de questionnaire formation
"
,
related
=
"
survey_id.training_survey_type
"
,
related
=
"
survey_id.training_survey_type
"
,
...
@@ -31,50 +29,10 @@ class SurveyUserInput(models.Model):
...
@@ -31,50 +29,10 @@ class SurveyUserInput(models.Model):
# ------------------------------------------------------
# ------------------------------------------------------
# Override ORM
# Override ORM
# ------------------------------------------------------
# ------------------------------------------------------
def
_mark_done
(
self
):
"""
Hérite la fonction parente pour gérer les inscriptions aux formations au moment
de la validation du questionnaire
"""
super
().
_mark_done
()
student_model
=
self
.
env
[
"
training.student
"
].
sudo
()
student_id
=
student_model
.
create
(
{
"
partner_id
"
:
self
.
partner_id
.
id
,
"
training_id
"
:
self
.
training_id
,
"
student_company
"
:
self
.
company
,
}
)
# Création de la réponse au sondage
answer_id
=
self
.
create
(
{
"
partner_id
"
:
self
.
partner_id
.
id
,
"
email
"
:
self
.
partner_id
.
email
,
"
nickname
"
:
self
.
partner_id
.
lastname
,
"
firstname
"
:
self
.
partner_id
.
firstname
,
"
company
"
:
self
.
company
,
"
survey_id
"
:
self
.
training_id
.
registration_survey_id
.
id
,
"
student_id
"
:
student_id
.
id
,
"
training_id
"
:
self
.
training_id
.
id
,
}
)
# ------------------------------------------------------
# ------------------------------------------------------
# Compute
# Compute
# ------------------------------------------------------
# ------------------------------------------------------
@api.depends
(
"
survey_id
"
)
def
_compute_training_id
(
self
):
for
user_input
in
self
:
user_input
.
training_id
=
self
.
env
[
'
training.training
'
].
search
(
[
(
'
registration_survey_id
'
,
'
=
'
,
user_input
.
survey_id
.
id
),
(
'
partner_id
'
,
'
=
'
,
user_input
.
partner_id
.
id
)
]
)
# ------------------------------------------------------
# ------------------------------------------------------
# Buttons
# Buttons
...
...
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