Commit Graph
12 Commits
Author SHA1 Message Date
Philippe Wauthy 88d0c49604 [FIX] resource: timezone end before assigning search_range
The end datetime is not timezoned in _adjust_to_calendar before defining the search_range and using the _get_closest_work_time method.
Since _get_closest_work_time will timezone the timestamp received to start searching, the search interval needs to refer to the same end timestamp to avoid erratic behaviors.

Task-2628876

closes odoo/odoo#79049

X-original-commit: cbf0cb6e210959b3ceea554ec68957416a125141
Related: odoo/enterprise#21915
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-27 21:06:48 +00:00
jbm-odoo 1e8db02368 [IMP] resource: Manage calendars over 2 weeks
Purpose
=======

In Belgium, we need to support some partial time on 2 weeks.
For instance, a mid time, means you could work on monday, tuesday
and wednesday on week1 and monday and tuesday on week 2. Others payroll
softwares manage this.

Specification
=============

Add a checkbox on resource calendar to manage 2 weeks. --> Consider even/odd weeks.
Add sections on calendars (Like sales orders)
Modify methods in resources to apply this behavor generically.

Check that attendances aren't overlapped

Write an integration test for holidays - benefits - payslip
to check all this, + "credit temps" and wage modification.

Note
====

For the sake of simplicity, we only manage calendars over 2 weeks
to consider the odd/even weeks and keep an easy implementation.
For more complicated calendars (eg: over a months with specific targetted days),
it's better to create specific allocation requests and apply specific leaves
for those days, as it would be the case for parental leaves.

closes odoo/odoo#31674

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-25 08:02:14 +00:00
Raphael Collet 975c6c8639 [REF] resource calendar (#24717)
Refactor resource calendar and resource mixin:
 - add a required timezone field on models 'resource.calendar' and 'resource.resource';
 - resource calendar attendances are now computed in the timezone of the resource
   or the calendar;
 - improve API of 'resource.calendar' and 'resource.mixin';
 - avoid other modules from using the implementation methods of 'resource.calendar';
 - refactor implementation of 'resource.calendar' to make it more efficient.
2018-05-31 20:28:12 +02:00
Thibault Delavallée ac26fa3dd4 [REF] resource: include attendance and leave info in intervals
Calendar and resource scheduling work on time intervals. However in some
cases it is useful to have info about attendances and / or leaves linked
to those intervals. Internal interval tuples is thus extended to keep
records about resource.calendar.attendance and resource.calendar.leaves.
This will notably allow to remove some hacks in stock_calendar module.
Hooray.
2017-02-27 14:04:48 +01:00
Thibault Delavallée 1c4ea80f78 [IMP] resource: clean tests code
This commit cleans resource test code by removing unnecessary stuff
and simplifying code. Purpose is to lessen number of lines and improve
readability of tests. Some duplicated tests have been removed.
2017-01-18 10:24:24 +01:00
Ravi Gohil dc77ed4f90 [MIG] resource: Migrated unittest cases to new api
- Converted yml test cases to python unittest
- now, 'self.calendar' recordset from common.py will carry forward its context
  so no need to pass context explicitely to the methods calling using that recordset.
- removed commented code
- used odoo.fields.Datetime to covert dates instead of python datetime library
2016-07-13 12:53:34 +02:00
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Christophe Simonis 024177ebc4 [FIX] resource: get_working_intervals_of_day
Use patch from 8.0 (64e1c28e35) instead of
the one from 7.0 (bbd15cdca6).
2015-09-11 18:07:49 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Thibault Delavallée 9fbbba1ee0 [IMP] resource : some docstrings cleaning + void calendar
taken into account in days scheduling + finished yesys

bzr revid: tde@openerp.com-20140122132918-4c1ag6y5gqasi32d
2014-01-22 14:29:18 +01:00
Thibault Delavallée af79a26a1f [IMP] resource: overall fix of hours/days computation + scheduling + added tests
bzr revid: tde@openerp.com-20130830133250-ixehp7imac0duygd
2013-08-30 15:32:50 +02:00
Thibault Delavallée a67459018c [IMP] resource: first refactoring of various methods to calculate timed intervals based on resource.calendar. Added tests.
bzr revid: tde@openerp.com-20130821105109-1rtynzx69hmslxey
2013-08-21 12:51:09 +02:00