-
-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[11.0][MIG] hr_contract_default_trial_length
- Loading branch information
Jaime Arroyo
committed
Jul 24, 2019
1 parent
7edd6e0
commit 5706513
Showing
15 changed files
with
123 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module does not require any special configuration apart from enabling it as | ||
shown above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* Salton Massally (iDT Labs) <smassally@idtlabs.sl> | ||
* Julien Laloux <julien.laloux@jlaloux.be> | ||
* Jaime Arroyo <jaime.arroyo@creublanca.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This addon allows you to define default trail length for contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
To install this module, you need to: | ||
|
||
* clone the branch 11.0 of the repository https://github.com/OCA/hr | ||
* add the path to this repository in your configuration (addons-path) | ||
* update the module list | ||
* search for "Default Contract Trail Length" in your addons | ||
* install the module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Contract trial length can also depend on contract duration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Set your trail length on your contract types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_trial_length |
30 changes: 30 additions & 0 deletions
30
hr_contract_default_trial_length/tests/test_trial_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2018 Eficent Business and IT Consulting Services, S.L. | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestTrialLength(TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.type1 = self.env['hr.contract.type'].create({ | ||
'name': 'Type 1', | ||
'trial_length': 20, | ||
}) | ||
self.type2 = self.env['hr.contract.type'].create({ | ||
'name': 'Type 2', | ||
'trial_length': 10, | ||
}) | ||
self.contract = self.env['hr.contract'].create({ | ||
'name': 'Contract', | ||
'type_id': self.type1.id, | ||
'date_start': '2019-10-10', | ||
'wage': 50000, | ||
}) | ||
|
||
def test_onchange_trial_date_start(self): | ||
self.contract.write({'type_id': self.type2.id}) | ||
self.contract.onchange_trial_date_start() | ||
self.assertEqual(self.contract.trial_date_end, '2019-10-20') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters