Changes to be committed:
Deploy via Portainer / deploy (push) Successful in 0s

new file:   .gitea/workflows/deploy.yml
	modified:   compta/templates/compta/base.html
	modified:   compta/templates/compta/gestion.html
	modified:   compta/templates/compta/import_csv.html
	modified:   compta/templates/compta/saisie_paiement.html
	modified:   compta/views_gestion.py
	modified:   compta/views_import.py
	modified:   compta/views_saisie.py
This commit is contained in:
2026-07-12 00:20:33 +02:00
parent 757c0850c3
commit 888bcfa213
8 changed files with 370 additions and 289 deletions
+16 -2
View File
@@ -204,10 +204,24 @@ def _traiter_post(request):
if entreprise is None:
return redirect(reverse("gestion"))
action = request.POST.get("action")
modeles = {"recette": Facture, "depense": Depense, "operation": Paiement}
if action == "delete_bulk":
n = 0
for token in request.POST.getlist("sel"):
t, _, pk = token.partition(":")
Mod = modeles.get(t)
if not Mod or not pk:
continue
obj = Mod.objects.filter(entreprise=entreprise, pk=pk).first()
if obj:
obj.delete()
n += 1
messages.success(request, f"{n} opération(s) supprimée(s).")
return _retour(request, entreprise)
typ = request.POST.get("type")
oid = request.POST.get("id")
modeles = {"recette": Facture, "depense": Depense, "operation": Paiement}
Modele = modeles.get(typ)
if not Modele:
return _retour(request, entreprise)