diff --git a/pkg/odoo/employee.go b/pkg/odoo/employee.go index a292024..698f982 100644 --- a/pkg/odoo/employee.go +++ b/pkg/odoo/employee.go @@ -7,8 +7,6 @@ import ( type Employee struct { ID int `json:"id"` Name string `json:"name"` - // AttendanceAccess returns true if the requesting user id has access to read attendances of this employee. - AttendanceAccess bool `json:"attendance_access"` } // SearchEmployee searches for an Employee with the given searchString in the Employee.Name. @@ -53,7 +51,7 @@ func (c *Client) FetchEmployee(sid string, userId int) (*Employee, error) { body, err := NewJsonRpcRequest(&ReadModelRequest{ Model: "hr.employee", Domain: []Filter{[]interface{}{"user_id", "=", userId}}, - Fields: []string{"name", "attendance_access"}, + Fields: []string{"name"}, Limit: 0, Offset: 0, }).Encode() diff --git a/pkg/web/attendance_handlers.go b/pkg/web/attendance_handlers.go index e56a557..eae89ac 100644 --- a/pkg/web/attendance_handlers.go +++ b/pkg/web/attendance_handlers.go @@ -40,10 +40,6 @@ func (s Server) OvertimeReport() http.Handler { view.ShowError(w, fmt.Errorf("no user matching '%s' found", searchUser)) return } - if !e.AttendanceAccess { - view.ShowError(w, fmt.Errorf("you don't have access to read attendances of '%s'", e.Name)) - return - } employee = e } else { e, err := s.odoo.FetchEmployee(session.ID, session.UID)