GithubHelp home page GithubHelp logo

hr-attendance's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

hr-attendance

TODO: add repo description.

This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

hr-attendance's People

Contributors

oca-git-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hr-attendance's Issues

Odoo 14 - hr_attendance_autoclose - Install error

Module

hr_attendance_autoclose

Describe the bug

Unable to install, getting this error,

Error:
Odoo Server Error

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 530, in _tag_record
raise Exception("Cannot update missing record %r" % xid)
Exception: Cannot update missing record 'base.main_company'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 912, in call
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1393, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1381, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_install
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 475, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 593, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 221, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 685, in _tag_root
)) from e
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/hr_attendance_autoclose/data/res_company.xml:3, near


To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. Copy the module to addons folder
  2. Update Apps
  3. Install

Expected behavior
Should install without errors.

Additional context
I was able to solve by removing the data/res_company.xml file from the manifest

hr_attendance_sheet calculation of end_date does not work reliable

module: hr_attendance_sheet
version: 14.0

I started to dive into hr_attendance_sheet and provide a migration to version 15.0 in PR #114

Unfortunately, either version 14.0 nor 15.0 are working properly for a sheet range MONTHLY.

Problem 1 in Odoo 14 - wrong calculation of "Date To"

Steps to reproduce

  • create a company
  • activate Use Attendance Sheets
  • set Attendance Sheet Range Month
  • set "Date From" e.g. 2023-02-01
  • save
  • set "Date From" e.g. 2023-01-01 (or any other month)

Current behavior

  • "Date To" get's no / wrong update
  • reason for this: the calculation of "Date To" (end_date) is done based on the stored value of date_start and NOT based on the current selected value of "Date From".

Odoo (4)

Expected behavior

  • "Date To" should always be calculate on base on the currently entered value of "Date From".

Problem 2 in Odoo 14

Steps to reproduce

  • create a company with
  • set Attendance Sheet Range Month
  • set "Date From" = 2023-01-01
  • set "Date To" = 2023-01-31 (fix this in database because of problem 1 above)
  • activate attendance sheet in one employee
  • run the Attendance Sheets: Create Sheets job twice

Current behavior

  • The first sheet is created correctly from 2023-01-01 to 2023-01-31
  • The second sheet is wrong. It is valid from 2023-02-01 to 2023-01-31 - from past to present, one day.
  • The date_end field in the database is now wrong:

Edit  res_company - db - Adminer

  • no forther sheets are created by Attendance Sheets: Create Sheets

In Odoo 15 I have similar problems. I fixed it with my basic knowledge of python programing and will provide a patch / pull request. But someone with more experience should review this or make a better fix.

Currently the pull request is referenced on my fork in albig#1

[13.0] hr_attendance_report_theoretical_time: Incompatibility with hr_expense

You get an error creating expense report with employee without access to private addresses.

Steps to reproduce:

  • Create a user without access to private addresses.
  • Create employee for this user
  • Create a expenses
  • In expense form, save and click on "Create report" Button

2020-11-11 08-01-53

Error reason:

In hr standard module we have hr.employee and hr.employee.public, hr.employee.public is a sql view to get readonly acces to employee.

When you create a report with user without private addresses access you spect to get all fields created on hr.employee.

Maybe this is Odoo bug, and not bug on this report, but to prevent this error you can create this fields also in hr.employee.public.

Migration to version 16.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

Auto close breaks timeoff request

Module

hr_attendance_autoclose

Describe the bug

ValueError: Invalid field 'no_autoclose' on model 'hr.employee.public'

To Reproduce

install timeoff and autoclose together and try to request timeoff with regular user.

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Алдаа:
Odoo Server Error

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 748, in get
value = self._data[field][record._ids[0]]
KeyError: <NewId 0x7fbb2943fb00>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1038, in get
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 754, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('hr.leave(<NewId 0x7fbb2943fb00>,).number_of_hours_display', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 748, in get
value = self._data[field][record._ids[0]]
KeyError: 369

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1038, in get
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 754, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('hr.employee(369,).resource_calendar_id', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in call
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1342, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1334, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 390, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 377, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 6265, in onchange
value = record[name]
File "/usr/lib/python3/dist-packages/odoo/models.py", line 5761, in getitem
return self._fields[key].get(self, type(self))
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1062, in get
self.compute_value(recs)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1147, in compute_value
records._compute_field_value(self)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 4018, in _compute_field_value
getattr(self, field.compute)()
File "/usr/lib/python3/dist-packages/odoo/addons/hr_holidays/models/hr_leave.py", line 457, in _compute_number_of_hours_display
calendar = holiday._get_calendar()
File "/usr/lib/python3/dist-packages/odoo/addons/hr_holidays/models/hr_leave.py", line 452, in _get_calendar
return self.employee_id.resource_calendar_id or self.env.company.resource_calendar_id
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 2370, in get
return super().get(records, owner)
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1045, in get
recs._fetch_field(self)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3003, in _fetch_field
self._read(fnames)
File "/usr/lib/python3/dist-packages/odoo/addons/hr/models/hr_employee.py", line 133, in _read
res = self.env['hr.employee.public'].browse(self.ids).read(fields)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 2952, in read
raise ValueError("Invalid field %r on model %r" % (name, self._name))
ValueError: Invalid field 'no_autoclose' on model 'hr.employee.public'

error related to auto_close in V14

hi,

receiving this error for all employee ( non-admin) when applying time-off
Admin user however can apply. Not sure whats broken here..

Please let me know wats the work around to have this working ?
used hr-autoclose and hr-reason modules.

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/odoo/odoo-server/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 347, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1389, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 396, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 383, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/odoo/models.py", line 6236, in onchange
    for name in nametree
  File "/odoo/odoo-server/odoo/models.py", line 6237, in <listcomp>
    if name not in done and snapshot0.has_changed(name)
  File "/odoo/odoo-server/odoo/models.py", line 6068, in has_changed
    return self[name] != record[name]
  File "/odoo/odoo-server/odoo/models.py", line 5666, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/odoo/odoo-server/odoo/fields.py", line 1019, in __get__
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1175, in compute_value
    records._compute_field_value(self)
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/odoo/odoo-server/odoo/models.py", line 4061, in _compute_field_value
    getattr(self, field.compute)()
  File "/odoo/odoo-server/addons/hr_holidays/models/hr_leave.py", line 531, in _compute_number_of_hours_text
    float_round(leave.number_of_hours_display, precision_digits=2),
  File "/odoo/odoo-server/odoo/fields.py", line 1019, in __get__
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1175, in compute_value
    records._compute_field_value(self)
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/odoo/odoo-server/odoo/models.py", line 4061, in _compute_field_value
    getattr(self, field.compute)()
  File "/odoo/odoo-server/addons/hr_holidays/models/hr_leave.py", line 492, in _compute_number_of_hours_display
    calendar = holiday._get_calendar()
  File "/odoo/odoo-server/addons/hr_holidays/models/hr_leave.py", line 487, in _get_calendar
    return self.employee_id.resource_calendar_id or self.env.company.resource_calendar_id
  File "/odoo/odoo-server/odoo/fields.py", line 2483, in __get__
    return super().__get__(records, owner)
  File "/odoo/odoo-server/odoo/fields.py", line 996, in __get__
    recs._fetch_field(self)
  File "/odoo/odoo-server/odoo/models.py", line 3069, in _fetch_field
    self._read(fnames)
  File "/odoo/odoo-server/addons/hr/models/hr_employee.py", line 135, in _read
    res = self.env['hr.employee.public'].browse(self.ids).read(fields)
  File "/odoo/odoo-server/odoo/models.py", line 3009, in read
    raise ValueError("Invalid field %r on model %r" % (name, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'no_autoclose' on model 'hr.employee.public'

[13.0][hr_attendance_report_theoretical_time] Theoretical hours as 0 if less than a day leave

When I ask for a leave which is for less than one day (half day checkbox DISABLED), and that leave is approved, I go to my attendandes -> hr.attendance.theoretical.time.report pivot view and the day I selected as a leave marks 0 theoretical hours.

Practical example:

I select a 0.5 days leave for 24th march (a day I should be working 8 hours). Then the theoretical hours field should me marking 4 hours, but it displays 0.

I attached two images so you can see the problem visually.

peticion
theo

Migration to version 15.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[16.0] [hr_attendance_report_theoretical_time] recompute theoretical attendance does not respect contractual hours

Module

hr_attendance_report_theoretical_time

Describe the bug

When recomputing theoretical hours, the current resource_calendar is used to recompute the theoretical attendance, not respecting past contracts with different calendars.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Create a contract valid in the past with e.g. 40h calendar
  2. Create attendance entries in the period of the past contract
  3. Create a second contract with e.g. 35h calendar
  4. Create attendance entries in the period of the new contract
  5. Recompute theoretical attendance in the period of both contracts

Expected behavior
Entries should respect the contractual resource_calendar of their period and only fall back on the current resource_calendar if no contract is available during the working period.

Additional context
Also new entries in the past should respect the calendar which was valid during the time period.

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.