[UPDT] PMS: Employee objective list, view permission is added to reporting managers

This commit is contained in:
Horilla
2025-10-28 10:02:09 +05:30
parent cfb335821f
commit 7abbe94752
2 changed files with 39 additions and 29 deletions

View File

@@ -12,7 +12,7 @@
</div> </div>
{% endif %} {% endif %}
{% for emp_objective in emp_objectives.object_list %} {% for emp_objective in emp_objectives.object_list %}
{% if perms.pms.view_employeeobjective or emp_objective|is_manager_or_owner:request.user %} {% if perms.pms.view_employeeobjective or emp_objective|is_manager_or_owner:request.user or is_reporting_manager %}
<div class="oh-accordion-meta"> <div class="oh-accordion-meta">
<div class="oh-accordion-meta__item"> <div class="oh-accordion-meta__item">
<div class="oh-accordion-meta__header" <div class="oh-accordion-meta__header"

View File

@@ -70,23 +70,28 @@
</span> </span>
</div> </div>
<div class="oh-sticky-table__td">{{kr.start_value}}</div> <div class="oh-sticky-table__td">{{kr.start_value}}</div>
{% if perms.pms.change_employeeobjective or emp_objective|is_manager:request.user %}
<div class="oh-sticky-table__td"> <div class="oh-sticky-table__td">
<input <input
id = {{kr.id}} id = {{kr.id}}
type="number" class="oh-input p-1" min="0" type="number" class="oh-input p-1"
max="{{kr.target_value}}" style="width: 100px;"
min="0"
value="{{kr.current_value}}" value="{{kr.current_value}}"
{% comment %} hx-post="{%url 'employee-keyresult-update-current_value' kr.id %}"
hx-trigger="change"
hx-target="#emp_objective_card" {% endcomment %}
name="current_value" name="current_value"
onchange="delayedProgress(this)" onchange="delayedProgress(this)"
/> />
</div> </div>
{% else %}
<div class="oh-sticky-table__td">{{kr.current_value}}</div>
{% endif %}
<div class="oh-sticky-table__td " data-value="{{kr.target_value}}" >{{kr.target_value}}</div> <div class="oh-sticky-table__td " data-value="{{kr.target_value}}" >{{kr.target_value}}</div>
<div class="oh-sticky-table__td p-percentage" >{{kr.progress_percentage}}% </div> <div class="oh-sticky-table__td p-percentage" >{{kr.progress_percentage}}% </div>
<div class="oh-sticky-table__td">{{kr.start_date}}</div> <div class="oh-sticky-table__td">{{kr.start_date}}</div>
<div class="oh-sticky-table__td">{{kr.end_date}}</div> <div class="oh-sticky-table__td">{{kr.end_date}}</div>
{% if perms.pms.change_employeeobjective or emp_objective|is_manager:request.user %}
<div class="oh-sticky-table__td"> <div class="oh-sticky-table__td">
<select <select
id="keyResultStatus" name="key_result_status" id="keyResultStatus" name="key_result_status"
@@ -102,6 +107,11 @@
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
{% else %}
<div class="oh-sticky-table__td">
{{ kr.get_status_display }}
</div>
{% endif %}
{% if perms.pms.change_employeeobjective or kr.employee_objective_id|is_manager:request.user %} {% if perms.pms.change_employeeobjective or kr.employee_objective_id|is_manager:request.user %}
<div class="oh-sticky-table__td oh-sticky-table__right" onclick="event.stopPropagation()"> <div class="oh-sticky-table__td oh-sticky-table__right" onclick="event.stopPropagation()">
<div class="oh-btn-group"> <div class="oh-btn-group">