summaryrefslogtreecommitdiff
path: root/addons/resource
diff options
context:
space:
mode:
authorjbm-odoo <jbm@odoo.com>2019-02-21 16:18:48 +0000
committerYannick Tivisse <yti@odoo.com>2019-04-17 12:08:29 +0000
commitdbd6fb4e8c43ac0f7b406eebedcaa5d6da56a142 (patch)
tree2e3eb348a6c5c1c3a2201c34a486169baea5d7f3 /addons/resource
parentc159735a5493217d665865ccea5f86e9f26d80df (diff)
[IMP] l10n_be_hr_payroll: manage credit time during contract
In Belgium, we have the concept of time credit and parental leaves. Globally the person keep full time rights and the initial contract is always signed on a full time basis. But an avenant with the new time schedule must be signed. A new wizard on contract allows to manage credit time. We can specify the start and stop date, the new calendar and the work time ratio. The new wage will be computed. After validation, the current contract will be duplicate two times, one modified for the time credit contract and the second for after the time credit period. The current contract will have end date at the beginnig of the time credit period. TaskID: 1924200
Diffstat (limited to 'addons/resource')
-rw-r--r--addons/resource/models/resource.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/addons/resource/models/resource.py b/addons/resource/models/resource.py
index 2c1db4a5bd3..717fa0faae0 100644
--- a/addons/resource/models/resource.py
+++ b/addons/resource/models/resource.py
@@ -151,29 +151,28 @@ class ResourceCalendar(models.Model):
res = super(ResourceCalendar, self).default_get(fields)
if not res.get('name') and res.get('company_id'):
res['name'] = _('Working Hours of %s') % self.env['res.company'].browse(res['company_id']).name
+ if not res.get('attendance_ids'):
+ res['attendance_ids'] = [
+ (0, 0, {'name': _('Monday Morning'), 'dayofweek': '0', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
+ (0, 0, {'name': _('Monday Afternoon'), 'dayofweek': '0', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
+ (0, 0, {'name': _('Tuesday Morning'), 'dayofweek': '1', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
+ (0, 0, {'name': _('Tuesday Afternoon'), 'dayofweek': '1', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
+ (0, 0, {'name': _('Wednesday Morning'), 'dayofweek': '2', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
+ (0, 0, {'name': _('Wednesday Afternoon'), 'dayofweek': '2', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
+ (0, 0, {'name': _('Thursday Morning'), 'dayofweek': '3', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
+ (0, 0, {'name': _('Thursday Afternoon'), 'dayofweek': '3', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
+ (0, 0, {'name': _('Friday Morning'), 'dayofweek': '4', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
+ (0, 0, {'name': _('Friday Afternoon'), 'dayofweek': '4', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'})
+ ]
return res
- def _get_default_attendance_ids(self):
- return [
- (0, 0, {'name': _('Monday Morning'), 'dayofweek': '0', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
- (0, 0, {'name': _('Monday Afternoon'), 'dayofweek': '0', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
- (0, 0, {'name': _('Tuesday Morning'), 'dayofweek': '1', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
- (0, 0, {'name': _('Tuesday Afternoon'), 'dayofweek': '1', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
- (0, 0, {'name': _('Wednesday Morning'), 'dayofweek': '2', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
- (0, 0, {'name': _('Wednesday Afternoon'), 'dayofweek': '2', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
- (0, 0, {'name': _('Thursday Morning'), 'dayofweek': '3', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
- (0, 0, {'name': _('Thursday Afternoon'), 'dayofweek': '3', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'}),
- (0, 0, {'name': _('Friday Morning'), 'dayofweek': '4', 'hour_from': 8, 'hour_to': 12, 'day_period': 'morning'}),
- (0, 0, {'name': _('Friday Afternoon'), 'dayofweek': '4', 'hour_from': 13, 'hour_to': 17, 'day_period': 'afternoon'})
- ]
-
name = fields.Char(required=True)
company_id = fields.Many2one(
'res.company', 'Company',
default=lambda self: self.env['res.company']._company_default_get())
attendance_ids = fields.One2many(
'resource.calendar.attendance', 'calendar_id', 'Working Time',
- copy=True, default=_get_default_attendance_ids)
+ copy=True)
leave_ids = fields.One2many(
'resource.calendar.leaves', 'calendar_id', 'Time Off')
global_leave_ids = fields.One2many(