Comments (4)
I've fixed it for me:
@api.model
def get_attrition_rate(self):
month_attrition = []
monthly_join_resign = self.join_resign_trends()
month_join = monthly_join_resign[0]['values']
month_resign = monthly_join_resign[1]['values']
sql = """
SELECT (date_trunc('month', CURRENT_DATE))::date - interval '1' month * s.a AS month_start
FROM generate_series(0,11,1) AS s(a);"""
self._cr.execute(sql)
month_start_list = self._cr.fetchall()
for month_date in month_start_list:
self._cr.execute("""select count(id), to_char(date '%s', 'Month YYYY') as l_month from hr_employee
where resign_date > date '%s' or resign_date is null and joining_date < date '%s'
""" % (month_date[0], month_date[0], month_date[0],))
month_emp = self._cr.fetchone()
# month_emp = (month_emp[0], month_emp[1].split(' ')[:1][0].strip()[:3])
month_join_filter = filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_join)
match_join = 0
if len(tuple(month_join_filter)) > 0:
match_join = list(month_join_filter)[0]['count']
month_resign_filter = filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_resign)
match_resign = 0
if len(tuple(month_resign_filter)) > 0:
match_resign = list(month_resign_filter)[0]['count']
month_avg = (month_emp[0] + match_join - match_resign + month_emp[0]) / 2
attrition_rate = (match_resign / month_avg) * 100 if month_avg != 0 else 0
vals = {
# 'month': month_emp[1].split(' ')[:1][0].strip()[:3] + ' ' + month_emp[1].split(' ')[-1:][0],
'month': month_emp[1].split(' ')[:1][0].strip()[:3],
'attrition_rate': round(float(attrition_rate), 2)
}
month_attrition.append(vals)
return month_attrition
from openhrms.
Same on Odoo 12 CE
Erreur:
Odoo Server Error
Traceback (most recent call last):
File "/opt/openhrms/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/openhrms/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/openhrms/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/openhrms/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/opt/openhrms/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/openhrms/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/openhrms/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/openhrms/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/opt/openhrms/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/opt/openhrms/addons/web/controllers/main.py", line 962, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/openhrms/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/openhrms/odoo/api.py", line 755, in call_kw
return _call_kw_model(method, model, args, kwargs)
File "/opt/openhrms/odoo/api.py", line 728, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/openhrms/openhrms/hrms_dashboard/models/hrms_dashboard.py", line 400, in get_attrition_rate
match_join = list(filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_join))[0]['count']
IndexError: list index out of range
from openhrms.
DASHBOARD ERROR WHILE LOGING IN WITH USERS WITH ALLOWED WITH MULTIPLE COMPANY IN ODOO 11
Traceback (most recent call last):
File "/opt/openhrms/odoo/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/openhrms/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/openhrms/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/opt/openhrms/odoo/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/opt/openhrms/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/openhrms/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/openhrms/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/openhrms/odoo/http.py", line 939, in call
return self.method(*args, **kw)
File "/opt/openhrms/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/opt/openhrms/addons/web/controllers/main.py", line 934, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/openhrms/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/openhrms/odoo/api.py", line 697, in call_kw
return call_kw_model(method, model, args, kwargs)
File "/opt/openhrms/odoo/api.py", line 682, in call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/openhrms/openhrms/hrms_dashboard/models/hrms_dashboard.py", line 168, in get_upcoming
cr.execute(sql)
File "/opt/openhrms/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/opt/openhrms/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: operator does not exist: integer = boolean
LINE 15: and hea.employee = False))
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
from openhrms.
Hello any update about this error when loading the dashboard ? i'm using Odoo 13 CE
list(filter(lambda d: d['l_month'] == month_emp[1].split(' ')[:1][0].strip()[:3], month_join))[0][
IndexError: list index out of range
from openhrms.
Related Issues (20)
- Missing Owl Dependencies and lxml error
- Installing OpenHRMS Core breaks the instance
- 500 Internal Server Error from upgrade of hr_payroll_community conflict with matplotlib.dates HOT 1
- hr_payroll_community upgrade from 16.0.1.0.2 to 16.0.1.0.4
- Installation error employee_check_list (employee_documents_expiry is not available)
- Payslip Generating Taking Too Long For Employees > 50 with Too Many Salary Rules HOT 1
- Not able install openhrms in ubuntu 20.04, 22.04, and not able to add modules to windows
- HR Dashboard check in - Missing Record HOT 1
- [17.0] ohrms_overtime - KeyError: type_id new installation
- problem with "Open HRMS - HR Dashboard" module when the language Direction Right-to Left
- A user cannot be linked to multiple employees in the same company HOT 1
- Odoo CE 13 : Error on Batch Payslip Generation when install Employee Loan Management for dev_hr_loan
- OpenHRMS Arabic HOT 5
- I can't install Open HRMS Core (ohrms_core) in Odoo 15 on localhost over windows 10
- Windows 10 Odoo 15 OpenHRMS Dashboard
- Odoo 15 - Open HRMS not working with Code Backend Theme
- version conflict of pandas in installation in odoo16
- Page Zoom in Odoo 16
- Employee request overtime permission error
- Loan management with payroll HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openhrms.