-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][MIG] hr_holidays_credit: Migration to 16.0 #146
base: 16.0
Are you sure you want to change the base?
Conversation
Currently translated at 21.4% (3 of 14 strings) Translation: hr-12.0/hr-12.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_credit/fr/
Currently translated at 100.0% (14 of 14 strings) Translation: hr-12.0/hr-12.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_credit/fr/
Currently translated at 35.2% (6 of 17 strings) Translation: hr-holidays-14.0/hr-holidays-14.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-14-0/hr-holidays-14-0-hr_holidays_credit/hr/
Currently translated at 100.0% (17 of 17 strings) Translation: hr-holidays-14.0/hr-holidays-14.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-14-0/hr-holidays-14-0-hr_holidays_credit/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-holidays-14.0/hr-holidays-14.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-14-0/hr-holidays-14-0-hr_holidays_credit/
Currently translated at 100.0% (17 of 17 strings) Translation: hr-holidays-14.0/hr-holidays-14.0-hr_holidays_credit Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-14-0/hr-holidays-14-0-hr_holidays_credit/es/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works good, just please add some explanation on tests methods please.
I think this integration with v16 is ok. Now that Odoo added the option "Requires allocation" it makes sense that the "Allow credit" option is available only when the allocation is required.
cls.SudoAllocation = cls.Allocation.sudo() | ||
|
||
def test_1(self): | ||
employee = self.SudoEmployee.create({"name": "Employee #1"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
employee = self.SudoEmployee.create({"name": "Employee #1"}) | |
""" | |
Test that creating a leave without allowing credit raises a ValidationError, | |
and succeeds after enabling credit on the leave type. | |
""" | |
employee = self.SudoEmployee.create({"name": "Employee #1"}) |
) | ||
|
||
def test_2(self): | ||
department = self.SudoDepartment.create({"name": "Department #2"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
department = self.SudoDepartment.create({"name": "Department #2"}) | |
""" | |
Test that leave allocation validation respects department restrictions. | |
Leaves for employees in allowed departments succeed, while others raise ValidationError. | |
""" | |
department = self.SudoDepartment.create({"name": "Department #2"}) |
} | ||
) | ||
|
||
def test_3(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""
Test that leave allocation validation respects individual employee credit restrictions.
Leaves for employees with credit allowed succeed, while others raise ValidationError.
"""
) | ||
|
||
def test_4(self): | ||
employee = self.SudoEmployee.create({"name": "Employee #4"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
employee = self.SudoEmployee.create({"name": "Employee #4"}) | |
""" | |
Test the name_get method | |
""" | |
employee = self.SudoEmployee.create({"name": "Employee #4"}) |
self.assertTrue("credit" not in name) | ||
|
||
def test_5(self): | ||
employee = self.SudoEmployee.create({"name": "Employee #5"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
employee = self.SudoEmployee.create({"name": "Employee #5"}) | |
""" | |
Test that the name_get method includes 'available + credit' in the leave type name | |
when credit is allowed. | |
""" | |
employee = self.SudoEmployee.create({"name": "Employee #5"}) |
self.assertTrue("available + credit" in name) | ||
|
||
def test_6(self): | ||
employee = self.SudoEmployee.create({"name": "Employee #6"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
employee = self.SudoEmployee.create({"name": "Employee #6"}) | |
""" | |
Test that the name_get method includes 'used in credit' in the leave type name | |
when a leave consumes credit. | |
""" | |
employee = self.SudoEmployee.create({"name": "Employee #6"}) |
710496a
to
564069c
Compare
@AaronHForgeFlow Done, thanks! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🙂
No description provided.