Development #63847
Champ "motif d'absence" (user_absence_reason) sur une réservation (renommé en "user_check_type"), le transformer en FK
0%
Description
Actuellement on stocke le motif d'absence dans un CharField;
Changer ce champ, en faire une FK vers le model CheckType (nouveau nom du model AbsenceReason via #63810)
Afin de garantir que les types de pointage notés sur les réservations soient toujours justes:
- interdire la possibilité de changer de groupe de type de pointage au niveau d'un agenda
- interdire la suppression d'un type de pointage (ou d'un groupe) s'il est utilisé sur un Booking
- autoriser le renommage d'un type de pointage, mais avec un warning
- ajouter un flag disabled pour désactiver un type de pointage
Fichiers
Révisions associées
manager: can not change check_type_group if bookings are using it (#63847)
manager: do not delete used check types (#63847)
manager: warning on check_type edition if already used (#63847)
agendas: a check_type can be disabled (#63847)
Historique
Mis à jour par Lauréline Guérin il y a environ 2 ans
- Fichier 0005-agendas-a-check_type-can-be-disabled-63847.patch 0005-agendas-a-check_type-can-be-disabled-63847.patch ajouté
- Fichier 0004-manager-warning-on-check_type-edition-if-already-use.patch 0004-manager-warning-on-check_type-edition-if-already-use.patch ajouté
- Fichier 0003-manager-do-not-delete-used-check-types-63847.patch 0003-manager-do-not-delete-used-check-types-63847.patch ajouté
- Fichier 0002-manager-can-not-change-check_type_group-if-bookings-.patch 0002-manager-can-not-change-check_type_group-if-bookings-.patch ajouté
- Fichier 0001-agendas-Booking.user_check_type-becomes-a-FK-63847.patch 0001-agendas-Booking.user_check_type-becomes-a-FK-63847.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
basé sur #63810
0001: la migration du model et du code pour travailler avec une FK
0002: bloquage du changement de groupe de type de pointage sur un agenda si au moins une résa existe avec un user_check_type setté
0003: bloquage de la suppression d'un check_type utilisé (au passage, sur le model j'ai posé un on_delete=PROTECT, pour être sûre)
0004: petit warning à l'édition d'un check_type s'il est utilisé
0005: possibilité de disable un check_type; on ne pourra plus l'utiliser pour filtrer les résa sur l'écran de pointage, ni le setter sur une résa (écran de pointage et API)
Mis à jour par Valentin Deniaud il y a environ 2 ans
- Statut changé de Solution proposée à Solution validée
0002: je trouve ça étrange de voir disparaître le champ, ailleurs on est plutôt à taper des disabled (+ help_text pour expliquer) mais c'est un détail
Mis à jour par Lauréline Guérin il y a environ 2 ans
mais c'est un détail
Yes, ça peut se changer plus tard :)
Mis à jour par Lauréline Guérin il y a environ 2 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit f70aa2063a9ca758eedaa13271b88864b31d9a4b Author: Lauréline Guérin <zebuline@entrouvert.com> Date: Fri Apr 15 16:09:19 2022 +0200 agendas: a check_type can be disabled (#63847) commit 0b38a91b2e919592f47d0002ffd1e2cda7355263 Author: Lauréline Guérin <zebuline@entrouvert.com> Date: Fri Apr 15 15:33:08 2022 +0200 manager: warning on check_type edition if already used (#63847) commit 75044ae4f24cd1bf64945f0ebb942d2890da9047 Author: Lauréline Guérin <zebuline@entrouvert.com> Date: Fri Apr 15 15:10:55 2022 +0200 manager: do not delete used check types (#63847) commit 4b842886b0c5fb59017433fc46099d021b56898c Author: Lauréline Guérin <zebuline@entrouvert.com> Date: Fri Apr 15 14:48:36 2022 +0200 manager: can not change check_type_group if bookings are using it (#63847) commit e2cd0d6ad6f1465b5bf0b8e7a8b8d50e7ceb3b63 Author: Lauréline Guérin <zebuline@entrouvert.com> Date: Fri Apr 15 12:08:06 2022 +0200 agendas: Booking.user_check_type becomes a FK (#63847)
Mis à jour par Transition automatique il y a environ 2 ans
- Statut changé de Résolu (à déployer) à Solution déployée
agendas: Booking.user_check_type becomes a FK (#63847)