[FIX] PAYROLL: Mail sending issue for payslip individual view

This commit is contained in:
Horilla
2023-12-18 15:26:39 +05:30
parent 1f36eeb7e9
commit f5904a40d1
2 changed files with 2 additions and 2 deletions

View File

@@ -27,7 +27,7 @@
<div class="oh-payslip__net-payable-right" style="min-width: 20px; height: 35px; border: 1px solid hsl(213,22%,84%);">
<a href="{% url 'payslip-pdf' instance.id %}" type="button" title="{% trans 'Download' %}" class="oh-btn oh-btn--gray-bkg" style="height: 9px;"> <ion-icon name="download"></ion-icon></a>
{% if perms.payroll.add_payslip %}
<a href="{% url "send-slip" %}?id={{payslip.id}}" type="button" onclick="return confirm('Do you want to sent the payslip by mail?')" style="height: 9px;" title="{% trans 'Send via mail' %}" {% if payslip.sent_to_employee %}class="oh-btn sent-to-employee w-50"{% else %}class="oh-btn oh-btn--light-bkg w-50"{% endif %}> <ion-icon name="mail-outline"></ion-icon></a>
<a href="{% url "send-slip" %}?id={{instance.id}}" type="button" onclick="return confirm('Do you want to sent the payslip by mail?')" style="height: 9px;" title="{% trans 'Send via mail' %}" {% if payslip.sent_to_employee %}class="oh-btn sent-to-employee w-50"{% else %}class="oh-btn oh-btn--light-bkg w-50"{% endif %}> <ion-icon name="mail-outline"></ion-icon></a>
{% endif %}
</div>
</div>

View File

@@ -803,4 +803,4 @@ def send_slip(request):
mail_thread = MailSendThread(request, result_dict=result_dict, ids=pasylip_ids)
mail_thread.start()
messages.info(request, "Mail processing")
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))
return redirect(view_payslip)