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

[MIG] hr_infraction: migrate to 14.0 #37

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

al3ba
Copy link
Contributor

@al3ba al3ba commented May 19, 2022

No description provided.

@al3ba al3ba requested a review from mtelahun May 19, 2022 15:29
Copy link
Contributor

@mtelahun mtelahun left a comment

Choose a reason for hiding this comment

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

I'm impressed, Abel. Good job!

"author": "TREVI Software, Michael Telahun Makonnen",
"license": "AGPL-3",
"website": "https://github.com/trevi-software/trevi-hr",
"depends": ["hr", "hr_employee_status", "hr_job_transfer", "group_payroll_manager"],
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need group_payroll_manager? All it does is create Payroll Manager group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the group "group_payroll_manager" is associated with "ACL" defined in "hr_infraction" module.

access_hr_infraction_category_employee,access_hr_infraction_category,hr_infraction.model_hr_infraction_category,base.group_user,1,0,0,0
access_hr_infraction_category_user,access_hr_infraction_category,hr_infraction.model_hr_infraction_category,hr.group_hr_user,1,0,0,0
access_hr_infraction_category_manager,access_hr_infraction_category,hr_infraction.model_hr_infraction_category,hr.group_hr_manager,1,1,1,1
access_hr_infraction_pm,access_hr_infraction,hr_infraction.model_hr_infraction,group_payroll_manager.group_payroll_manager,1,0,0,0
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is any code that depends on the payroll module it (and related group permissions) should be moved to a separate module: hr_infraction_payroll

}
).create_action()
transfer = self.Transfer.search([], limit=1)
self.assertFalse(len(transfer) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a good assert. This assert would pass even if the transfer failed but the module's demo data contained a demo transfer. Instead include terms in the search domain that would uniquely identify the transfer you created.

Comment on lines +224 to +229
inf_action = self.InfractionAction.search(
[("infraction_id", "=", infraction.id)]
)
inf_waring = self.InfractionWarning.search(
[("action_id", "=", inf_action.id)]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this outside (above) the 'with' block.

Comment on lines +242 to +244
inf_action = self.InfractionAction.search(
[("infraction_id", "=", infraction.id)]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here: move above block



class InfractionBatch(models.TransientModel):
_name = "hr.infraction.batch"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just one test validating this model works as expected would be nice.

Comment on lines +224 to +229
inf_action = self.InfractionAction.search(
[("infraction_id", "=", infraction.id)]
)
inf_waring = self.InfractionWarning.search(
[("action_id", "=", inf_action.id)]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this outside (above) the 'with' block.

@mtelahun
Copy link
Contributor

mtelahun commented May 31, 2022 via email

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale label Oct 2, 2022
@mtelahun
Copy link
Contributor

mtelahun commented Nov 5, 2022

/trevibot rebase

@trevibot
Copy link
Contributor

trevibot commented Nov 5, 2022

Congratulations, PR rebased to 14.0.

@trevibot trevibot force-pushed the abel-mig-14.0-hr_infraction branch from c497a1b to 26214b4 Compare November 5, 2022 13:46
@github-actions github-actions bot removed the stale label Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants