horilla-opensource / horilla

Horilla is a free and open source HR software.
https://www.horilla.com/
GNU Lesser General Public License v2.1
208 stars 141 forks source link

Loan / Advanced Salary bug #344

Open loanduong02 opened 1 month ago

loanduong02 commented 1 month ago

Bug Report

When I create an Advanced Salary, double when created image

I cannot delete or edit it and get the following error

Description

/home/administrator/horilla/payroll/methods/methods.py:479: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'payroll.models.models.LoanAccount'> QuerySet. paginator = Paginator(qryset, get_pagination())

Internal Server Error: /payroll/create-loan/ Traceback (most recent call last): File "/home/administrator/horilla/horilla/decorators.py", line 234, in wrapped_view func = view_func(request, *args, kwargs) File "/home/administrator/horilla/horilla/decorators.py", line 260, in wrapped_view return view_func(request, *args, *kwargs) File "/home/administrator/horilla/horilla/decorators.py", line 41, in _function return function(request, args, kwargs) File "/home/administrator/horilla/payroll/views/component_views.py", line 1286, in create_loan if form.is_valid(): File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 201, in is_valid return self.is_bound and not self.errors File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 196, in errors self.full_clean() File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 434, in full_clean self._clean_form() File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 455, in _clean_form cleaned_data = self.clean() File "/home/administrator/horilla/payroll/forms/component_forms.py", line 664, in clean if cleaned_data.get("installment_start_date") < cleaned_data.get( TypeError: '<' not supported between instances of 'NoneType' and 'datetime.date'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/administrator/.local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/home/administrator/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "/home/administrator/horilla/horilla/decorators.py", line 249, in wrapped_view return view_func(request, *args, *kwargs) File "/home/administrator/horilla/horilla/decorators.py", line 260, in wrapped_view return view_func(request, args, kwargs) File "/home/administrator/horilla/horilla/decorators.py", line 41, in _function return function(request, *args, **kwargs) File "/home/administrator/horilla/payroll/views/component_views.py", line 1286, in create_loan if form.is_valid(): File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 201, in is_valid return self.is_bound and not self.errors File "/home/administrator/.local/lib/python3.10/site-packages/django/forms/forms.py", line 196, in errors self.full_clean()

horilla-opensource commented 1 month ago

Hi @loanduong02 ,

The fix is updated in the latest commit.

Please check and let us know if you have any questions or concerns.

With Regards, Team Horilla