diff --git a/offboarding/models.py b/offboarding/models.py
index 85c5b06d5..18b7977dd 100644
--- a/offboarding/models.py
+++ b/offboarding/models.py
@@ -295,7 +295,6 @@ class OffboardingNote(models.Model):
attachments = models.ManyToManyField(
OffboardingStageMultipleFile, blank=True, editable=False
)
- title = models.CharField(max_length=20, null=True)
description = models.TextField(null=True, blank=True,max_length=255)
note_by = models.ForeignKey(
Employee, on_delete=models.SET_NULL, null=True, editable=False
diff --git a/offboarding/templates/offboarding/note/view_notes.html b/offboarding/templates/offboarding/note/view_notes.html
index 31dda1b4a..3ba0e1fc0 100644
--- a/offboarding/templates/offboarding/note/view_notes.html
+++ b/offboarding/templates/offboarding/note/view_notes.html
@@ -1,43 +1,174 @@
{% load i18n static %}
-
-
- {% trans 'Add note' %}
-
-
\ No newline at end of file
+
+
+
+
+{% if employee.offboardingnote_set.all %}
+
+{% else %}
+
+
+
+
{% trans "No notes have been added for this employee" %}
+

+
+
+
+{% endif %}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/offboarding/templates/offboarding/pipeline/nav.html b/offboarding/templates/offboarding/pipeline/nav.html
index 7e9afe53b..7c9e677ee 100644
--- a/offboarding/templates/offboarding/pipeline/nav.html
+++ b/offboarding/templates/offboarding/pipeline/nav.html
@@ -33,3 +33,8 @@
+
diff --git a/offboarding/templates/offboarding/stage/stages.html b/offboarding/templates/offboarding/stage/stages.html
index 19854f0e4..7a8f00241 100644
--- a/offboarding/templates/offboarding/stage/stages.html
+++ b/offboarding/templates/offboarding/stage/stages.html
@@ -8,22 +8,6 @@
{% include "offboarding/stage/offboarding_body.html" %}
-
- """
- )
+ messages.success(request, _("Note added successfully"))
+ return redirect("view-offboarding-note", employee_id=employee.id)
return render(
- request, "offboarding/note/form.html", {"form": form, "employee": employee}
+ request,
+ "offboarding/note/view_notes.html",
+ {
+ "form": form,
+ "employee": employee,
+ },
)
+@login_required
+@manager_can_enter(perm="offboarding.delete_offboardingNote")
+def offboarding_note_delete(request, note_id):
+ """
+ This method is used to delete the offboarding note
+ """
+ try:
+ note = OffboardingNote.objects.get(id=note_id)
+ employee = note.employee_id.id
+ note.delete()
+ messages.success(request, _("Note deleted"))
+ except OffboardingNote.DoesNotExist:
+ messages.error(request, _("Note not found."))
+
+ return redirect("view-offboarding-note", employee_id=employee)
+
+
@login_required
@permission_required("offboarding.delete_offboardingnote")
def delete_attachment(request):
@@ -521,10 +542,17 @@ def task_assign(request):
offboarding = employees.first().stage_id.offboarding_id
stage_forms = {}
stage_forms[str(offboarding.id)] = StageSelectForm(offboarding=offboarding)
+ groups = pipeline_grouper({}, [task.stage_id.offboarding_id])
+ for item in groups:
+ setattr(item["offboarding"], "stages", item["stages"])
return render(
request,
"offboarding/stage/offboarding_body.html",
- {"offboarding": offboarding, "stage_forms": stage_forms},
+ {
+ "offboarding": groups[0],
+ "stage_forms": stage_forms,
+ "response_message": _("Task Assigned"),
+ },
)