Coder Social home page Coder Social logo

vshn / odootools Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 0.0 1.03 MB

VSHN-specific Odoo tool suite

Home Page: https://odootools.vshn.net

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.29% Go 87.56% HTML 10.39% Dockerfile 0.07% Smarty 0.69%
vshn-project-ignore

odootools's Introduction

Build Go version Version GitHub downloads License

odootools

odootools is a small tool that allows you to calculate overtime based on your attendances. It has VSHN-specific business rules integrated that are otherwise calculated manually.

Simply login with your Odoo credentials, configure the report settings and generate your reports.

It's currently aimed at Odoo 8.

Development

Documentation

See some development notes in CONTRIBUTING.md and docs/

Run the tool

First, you need to export Odoo settings:

export ODOO_URL=https://...
export ODOO_DB=...

You can run the tool in different ways:

  1. using make run (uses go run).
  2. using make run.docker (uses docker run)
  3. using a configuration of your favorite IDE

Deploy to OpenShift

Setup the project and deploy user

ns=vshn-odoo-prod
nstest=vshn-odoo-test
sa=odootools-deployer

oc new-project $ns
oc new-project $nstest

oc -n $ns create sa $sa

# Allow the deployer user to manage deployments in test namespace
oc -n $ns     policy add-role-to-user admin -z $sa --rolebinding-name admin
oc -n $nstest policy add-role-to-user admin -z $sa --rolebinding-name admin
oc -n $nstest policy add-role-to-user system:image-pusher -z $sa
oc -n $nstest patch rolebinding admin --type='json' -p='[{"op": "replace", "path": "/subjects/1/namespace", "value":"'$ns'"}]'
oc -n $nstest patch rolebinding system:image-pusher --type='json' -p='[{"op": "replace", "path": "/subjects/0/namespace", "value":"'$ns'"}]'

# Get SA token
oc -n $ns sa get-token $sa

Once this is set up, you can use the token in the CD settings: https://github.com/vshn/odootools/settings/secrets/actions

odootools's People

Contributors

anothertobi avatar bastjan avatar ccremer avatar finnschunk avatar mhutter avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

odootools's Issues

Feature Request: Overview of "Outside of office hours" Workhours

As a Responsible for VSHN Canada, I want to track the amount of "Outside of office hours" workhours of VSHN Switzerland so that I can track if VSHN Canada reduces the amount of nighttime work for VSHN Switzerland.

I would like to be at least able to see the amount of work hours summarized over all employees per Month (or better yet with a date range I can choose)

Feature Request: "Browse" buttons

When on a report, I would like to have buttons at the top to switch to the next/previous month.

Example controls:

  • < - previous month
  • Today - current month
  • > - next month

Consider alternative recording of timezone

Currently we save the timezone in the payslip and it applies to the whole month.
This is a major drawback for people that are changing timezones in the middle of the month, because recording attendance becomes a major pain.

The most correct way is to record attendance with the timezone information. Unfortunately Odoo 8 stores timestamps in UTC without timezone flag.

It might be possible to add a column in the timesheet view that contains the timezone field. If possible, an implementation could look like this:

  • Add the x_timezone field to the Attendance data model in Odoo
  • Add a column timezone to the timesheet view. The users working abroad can then set the timezone for each attendance, similarly how Sick Leave is recorded in a Dropdown menu.
  • If the field is empty, default to Europe/Zurich, either via Odoo itself or at latest in Odootools.
  • No longer save the timezone in the payslip
  • In odootools, apply the following precedence for timezone selection (first to last):
    • x_timezone field of an Attendance entry
    • x_timezone field of the current month's payslip
    • timezone setting in the user preferences
    • Europe/Zurich as the last-resort fallback (so that Switzerland-based employees don't need to change anything)

There is one advantage with saving the timezone in payslip: A timezone can be applied to the whole month. So if an employee is the whole month outside Switzerland, they can just save it once in the payslip and not record every individual attendance with the timezone field.

That being said, this feature resp. extra column is only relevant for people changing the timezone in the middle of the month, since the timezone for a whole month can still be specified via payslip.

Reasoning: User experience
It's easier to record attendance in the local timezone and set the timezone in the column from a dropdown, than having to record all attendances of a month in a single timezone when changing timezones in the middle of the month.

Feature Idea: Welcome Dashboard

I would love to have a welcome dashboard which shows some interesting data in an overview, leaving out all the details behind the already existing detailed views. And it could / should be some fun.

Ideas:

  • Sum of worked hours this year/month/week so far
  • Percentage of hours-to-be-worked already reached this year/month/week
  • Number of Legal Leaves taken so far, planned so far (future) and still to be planned
  • Current Calculated Balance
  • Last Definitive Balance
  • List of missing Timesheet entries, huge green checkmark if Timesheet is up-to-date

Replace deprecated packages

This project uses the Echo web framework for serving the website. The Echo framework itself is modular and uses some 3rd party dependencies to implement certain functionalities and middleware.
Some dependencies are from the Gorilla framework (https://github.com/gorilla)

Unfortunately, all Gorilla repositories haven been archived on the 9th of December 2022.

We therefore need to consider replacing those, either with forks or with other replacement dependencies.
We use currently:

Alternatives that I've found:

We might also consider integrating necessary parts of the source code of Gorilla's session here. I'm not an expert, but since both projects are BSD3-licensed, this should be fine AFAIU

Feature Idea: Make over/undertime visible

Goal: When browsing the monthly (or maybe also weekly) reports, make days with over/under time easily discernible.

  • Align the "Worked hours" and "Overtime hours" columns
  • Highlight over/under time (with colors)

Validate Timesheet entries

Currently, if a VSHNeer is not logged in or out properly, the calculation is off. There are reports where a single day can show 200+ hours. this obviously doesn't make sense, but it shows that this person didn't log their attendance correctly.

Add a functionality that somehow shows that attendance is logged incorrectly.
Attendances have to be logged just like in Odoo: sign in, sign out, sign in, sign out...
There can't be a "sign in", "sign out", "sign in" in past days.

Feature Request: Display report of the current week

As a user
I want an overview of the current week
So that I know if/when I have reached the 40h target worktime in a week

Implementation notes:

  • It makes little sense to display a "subtotal" in the monthly report, since a month can start or end in the middle of a week. This would make the current implementation of the monthly report very complex
  • Instead, create a new "weekly" report that displays the days from Monday to Sunday of the "current" week. The URL could look like report/<employee-ID>/week/yyyy-MM-dd where the date is "today", but internally it will figure out the previous Monday and next Sunday to determine the range of attendance to search for.
  • It may make sense to refactor the pkg/timesheet calculator so that it can calculate the overtime between arbitrary date ranges (given the attendances ofc), not just full months. Pay attention to the timezone
  • Notable idea that differs from the monthly report: Detect if the user is still logged in (aka no "sign out" as the last attendance entry) and consider this also in the overtime calculation (basically up until now()). Currently the monthly reporter recognizes only "completed" shifts resp. attendance blocks.
  • Consider displaying such an overview already in the /report "Create report" view for a fast and easy UX.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Feature Idea: Better handling of timezones for VSHN Canada

Currently Odootools uses hardcoded timezone "Europe/Zurich".
People that stay in Canada can't really use this tool, as the sign-in and -out times are broken (the calculator spits out very strange numbers for overtime)

Ideas:

  • Use timezone from browser (unreliable)
  • Add a toggle to use Canada time in the reporting view
  • Something else?

Feature Request: Read FTE ratio from Odoo

Currently, one has to manually enter the FTE ration when generating a monthly report.
However, Odoo has this information already and there are people that change often their workload.

It would be easier if the Odoo first requests the workload and adjusts the overtime accordingly.

Note: It's possible that the workload may change in a month on a certain day. So it could be that the calculator needs to respect a previous workload and then change in the middle of the month.

Monthly report should respect current payslip

At the moment, when browsing through older monthly reports, the "new balance" cell contains the calculated overtime, based on the last issued payslip.

This value is purely calculated and may not reflect the value on the payslip of the according month. The value in the payslip takes precedence though.

Proposal: Add another cell that shows the value in the payslip in addition to the calculated one. This shows potential discrepancies for transparency.

Feature Idea: Ignore Employees in Employee report

Currently, every Employee with a @vshn.ch email address is listed in the employee report (provided that there is a day within the contract dates).
However, currently it also includes employees that are part of VSHN, but don't use Odoo to record attendances, e.g. people working full-time in Canada office or are legally contractors.

In those cases, the employee report will show a warning that generating reports fails for those employees.
This warning can be removed by filtering the list of employees accordingly.

The problem is, to correctly determine the criteria to exclude them from the list. In Odoo, atm the list of Employees aren't consistently managed. The most logical field is "Office location" field, but for most employees this field is empty, some is set to "1. OG" (probably historically) and 1-2 have set it to "Canada".

So, in order to implement this feature we need:

  1. Cleanup the "Office location" field across all employees in Odoo, use it consistently. For example, on use values like Zurich, Vancouver, or Contractor. If empty, resort to Zurich.
  2. The Odoo query that gets the list of employees should be adjusted so that only people originally working from the Zurich office are listed.

Feature request: HR manager: Get List of employees and display their latest overtime

As a HR manager
I want to get a list of employees with their overtime
So that I can get an overview and don't have to iterate over each individual employee's monthly report.

Implementation idea:

  • with #60 done display an additional link in the nav bar only for HR managers
  • Render a list of employees with following data:
    • Last month's overtime
    • New overtime balance (overtime delta + value from last payslip)
    • Directlink to employee's monthly report
Name Delta Balance
Hans Muster +03:45 25:54
Melanie Mustermann -03:12 57:02

Feature Request: Overtime balance of year

VSHN has "Jahresarbeitszeit" model (annual working hours). It would be beneficial if one can see how much overtime has been achieved in a certain year.

This is not exactly the same as seeing the current balance accumulated from previous month (or year)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.