[FIX] STATIC: #819

This commit is contained in:
Horilla
2025-07-15 11:47:42 +05:30
parent 9edade5567
commit f1ed2fec6e
2 changed files with 12 additions and 0 deletions

View File

@@ -291,6 +291,16 @@ class LeaveType(HorillaModel):
)
def save(self, *args, **kwargs):
request = getattr(horilla_middlewares._thread_locals, "request", None)
selected_company = request.session.get("selected_company")
if (
not self.id
and not self.company_id
and selected_company
and selected_company != "all"
):
self.company_id = Company.find(selected_company)
if (
self.carryforward_type != "no carryforward"
and self.carryforward_max is None

View File

@@ -209,6 +209,8 @@ function toggleReimbursmentType(element) {
.parent()
.hide()
.attr("required", false);
// #819
$("#objectCreateModalTarget [name=employee_id]").trigger("change");
} else if (element.val() == "bonus_encashment") {
$("#objectCreateModalTarget [name=attachment]").parent().hide();
$("#objectCreateModalTarget [name=attachment]").attr("required", false);