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

[18.0][MIG] hr_holidays_public: Migration to 18.0 #147

Open
wants to merge 76 commits into
base: 18.0
Choose a base branch
from

Conversation

xaviedoanhduy
Copy link
Contributor

@xaviedoanhduy xaviedoanhduy commented Oct 14, 2024

Change on version 18.0

On the occasion

  • I also removed some redundant code in tests (no need to call the denpends function)

OCA - port

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-hr_holidays_public branch 2 times, most recently from ad805ca to 3592736 Compare October 14, 2024 10:35
@xaviedoanhduy xaviedoanhduy marked this pull request as draft October 14, 2024 10:38
@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-hr_holidays_public branch from 3592736 to 061cd2f Compare October 14, 2024 11:23
@xaviedoanhduy xaviedoanhduy marked this pull request as ready for review October 15, 2024 05:22
@pedrobaeza
Copy link
Member

/ocabot migration hr_holidays_public

Copy link
Member

@victoralmau victoralmau left a comment

Choose a reason for hiding this comment

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

Code and functional review ok.

Could yo squash administrative commits?

hr_holidays_public/models/hr_holidays_public.py Outdated Show resolved Hide resolved
hr_holidays_public/readme/CREDITS.md Show resolved Hide resolved
hr_holidays_public/views/hr_holidays_public_view.xml Outdated Show resolved Hide resolved
Fekete Mihai and others added 18 commits November 6, 2024 16:25
Add correct calculation of holidays in hr_public_holidays, instead of hr_holidays_compute_days.

Remove dependancy of contracts.

Add unlink at onchnage of public holiday lines.

Update code.

Fix flake.

Update code, add calculation in hours, update views.

Update flake.

Update calendar creation with no attendances, otherwise default values were set.

Remove config of show days/hours.

Update flake.

Update readme.

Rename module.

Updated holiday reports.

Update klake and pylint.

Update flaket.

Update hr_holidays_views.xml

Add readonly to show_full_days.

Update code according with comments.

Increase coverage.

update flake8.
Hours part will be in module hr_holidays_hour.
Reduce to the minimum the footprint of this module, adding only public
holidays as leaves in a transparent way by other modules.
This has been totally reworked for decoupling parts, not depending now
on hr_holidays_public, and making transparent its use for compatibility
with other modules.
Currently translated at 52.5% (21 of 40 strings)

Translation: hr-11.0/hr-11.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-11-0/hr-11-0-hr_holidays_public/de/
Currently translated at 55.0% (22 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/es/
Currently translated at 95.0% (38 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/fr/
Currently translated at 92.5% (37 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/es/
Currently translated at 92.5% (37 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/de/
Currently translated at 100.0% (40 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/es/
Currently translated at 45.0% (18 of 40 strings)

Translation: hr-12.0/hr-12.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_public/pt_BR/
sbejaoui and others added 15 commits November 6, 2024 16:41
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (40 of 40 strings)

Translation: hr-holidays-17.0/hr-holidays-17.0-hr_holidays_public
Translate-URL: https://translation.odoo-community.org/projects/hr-holidays-17-0/hr-holidays-17-0-hr_holidays_public/it/
…loyee

Use case:
- Go to Employees to an employee with a different address (country) than our
  own and with specific public holidays for that country.
- Go to the Time-off smart-buttons
- We will have to see there the public holidays according to the employee's address

TT49839
Helper functions to find public holidays did allow to use an hr.employee
to filter country and states based on the employee address.

Since only the address of the employee was used, modifying the functions
to use a res.partner instead of an hr.employee allows more possibilities
such as checking public holidays for customers and suppliers.
@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-hr_holidays_public branch from 242057b to 8117402 Compare November 6, 2024 09:42
@xaviedoanhduy
Copy link
Contributor Author

hi @victoralmau, thanks for the suggestions

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Member

We talk here about splitting the generic feature into a new module, and then provide an extension for HR:

#110 (comment)

And what about the feature that Odoo has about the same concept?

cc @grindtildeath

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-hr_holidays_public branch from 8117402 to 4c9c51b Compare November 11, 2024 05:00
@victoralmau
Copy link
Member

Please cherry-pick #156 + #157 to commit history.

My colleague's comment is still pending #147 (comment).

@grindtildeath
Copy link

@pedrobaeza I wish I had more time to dive into this topic because the model exists since a few versions, but AFAICT standard public holidays still don't have the same flexibility as we have in the OCA module.

I guess a first step to converge both modules would be to have "rules" allowing creation of resource calendar leaves from the OCA holidays public.

Still, IMO would be nice to split the module to remove dependency on HR, and provide extension module for HR.

@pedrobaeza
Copy link
Member

Yes, we have talked today in my team about the Odoo core feature and it seems less complete than current one, and switching doesn't worth.

@xaviedoanhduy
Copy link
Contributor Author

xaviedoanhduy commented Dec 26, 2024

hi i did some work:

let me know guys if this matches with your expectations

@victoralmau
Copy link
Member

Now that calendar_public_holiday already exists (OCA/calendar#142), I believe that this PR should be modified to depend on calendar_public_holiday and only add the corresponding holidays.
It would also be interesting migration scripts to convert the data: calendar.event.type and hr.holidays.public records to calendar.public.holiday (and lines).

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

Successfully merging this pull request may close these issues.