[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
This commit is contained in:
jbm-odoo
2019-04-17 12:08:29 +00:00
committed by Yannick Tivisse
parent c159735a54
commit dbd6fb4e8c
3 changed files with 17 additions and 15 deletions
+2
View File
@@ -86,6 +86,8 @@ class Contract(models.Model):
visa_expire = fields.Date('Visa Expire Date', related="employee_id.visa_expire", readonly=False)
reported_to_secretariat = fields.Boolean('Social Secretariat',
help='Green this button when the contract information has been transfered to the social secretariat.')
hr_responsible_id = fields.Many2one('res.users', 'HR Responsible', tracking=True,
help='Person responsible for validating the employee\'s contracts.')
def _expand_states(self, states, domain, order):
return [key for key, val in type(self).state.selection]
@@ -131,6 +131,7 @@
</div>
<field name="trial_date_end"/>
<field name="resource_calendar_id"/>
<field name="hr_responsible_id"/>
</group>
</group>
<group string="Notes">
+14 -15
View File
@@ -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(