Skip to content
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

Open
wants to merge 26 commits into
base: 16.0
Choose a base branch
from

Conversation

LauraCForgeFlow
Copy link

No description provided.

alexey-pelykh and others added 25 commits October 7, 2024 08:04
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/
Copy link

@AaronHForgeFlow AaronHForgeFlow left a 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"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):

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"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"})

@LauraCForgeFlow
Copy link
Author

@AaronHForgeFlow Done, thanks! :)

Copy link

@JoanSForgeFlow JoanSForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.