Purpose ======= An employee and its current contract should have the same calendar. Currently, if the contract's calendar is changed, the employee's calendar is not changed. In the same way, if a contract is created directly in `open` state, the employee's calendar is not changed. Finally, the calendar synchronization when the employee contract is changed is only done in payroll, for no reason. Specification ============= Fix the three issues described above. If the employee's calendar is nonetheless manually changed, a warning should be displayed if there is a mismatch between both calendars.
17 lines
482 B
Python
17 lines
482 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo.tests.common import TransactionCase
|
|
from dateutil.relativedelta import relativedelta
|
|
|
|
|
|
class TestContractBase(TransactionCase):
|
|
|
|
def setUp(self):
|
|
super(TestContractBase, self).setUp()
|
|
|
|
self.employee = self.env['hr.employee'].create({
|
|
'name': 'Richard',
|
|
'gender': 'male',
|
|
'country_id': self.ref('base.be'),
|
|
})
|