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][ADD] calendar_public_holiday #142

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

xaviedoanhduy
Copy link

@xaviedoanhduy xaviedoanhduy commented Dec 26, 2024

context:

note:

  • rename the hr.holidays.public model and related models to calendar.public.holiday to match the Calendar repo.
  • fix words like Holidays Public to Public holidays (because it is misspelled)
  • moving tests and modifications from the old module will only concern the scope of functions in this module.

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.

IMO the copyright of the corresponding files must be maintained to respect the attribution of all because this module is a “split” of the already existing hr_holidays_public module.

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch from 32696bf to aba0190 Compare January 10, 2025 02:37
@xaviedoanhduy
Copy link
Author

Code and functional review.

IMO the copyright of the corresponding files must be maintained to respect the attribution of all because this module is a “split” of the already existing hr_holidays_public module.

thanks for your suggestion, I have updated the copyright.

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.

@pedrobaeza
Copy link
Member

Isn't the migration scripts missing here?

@chienandalu
Copy link
Member

Isn't the migration scripts missing here?

I'd say that the hr_holidays_public stuff relative to time-off is goint to be still needed so the migration work could be done there, isn't it?

@pedrobaeza
Copy link
Member

pedrobaeza commented Jan 10, 2025

I think it should be done here, as the public holidays should be transferred here.

@xaviedoanhduy xaviedoanhduy marked this pull request as draft January 13, 2025 03:52
@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch 2 times, most recently from cad993b to bd79fb1 Compare January 13, 2025 04:00
@xaviedoanhduy xaviedoanhduy marked this pull request as ready for review February 5, 2025 11:34
@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch 3 times, most recently from 2546a7f to 642fbe5 Compare February 10, 2025 08:42
@victoralmau
Copy link
Member

Ping @pedrobaeza can you review it?

@pedrobaeza pedrobaeza added this to the 18.0 milestone Feb 12, 2025
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Thanks for the efforts. Apart from the inside comments, other points:

  • A plain user shouldn't be able to create nor modify public holidays as it's happening right now (try with demo user in runboat).
  • I think the menus should be inside Calendar > Configuration.

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch from 642fbe5 to b906adf Compare February 12, 2025 08:20
@xaviedoanhduy
Copy link
Author

xaviedoanhduy commented Feb 12, 2025

A plain user shouldn't be able to create nor modify public holidays as it's happening right now (try with demo user in runboat).

Hi @pedrobaeza, since this module no longer depends on hr_holidays but instead on the calendar module, so I changed the access of the models to be the same as in the dependent module (calendar) with the permission groups, see: https://github.com/odoo/odoo/blob/4209d441afa058a87e142b44d6e33a546741dd2b/addons/calendar/security/ir.model.access.csv?plain=1#L7-L8

@pedrobaeza
Copy link
Member

Yes, but they shouldn't follow the same rules, as public holidays are defined by managers, not by plain users. When adding hr_holidays_public, you can extend the permissions to allow HR managers to set them, but on this base module, only settings users should be able to modify this important information.

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch from b906adf to 7b016e0 Compare February 12, 2025 08:41
@xaviedoanhduy
Copy link
Author

xaviedoanhduy commented Feb 12, 2025

Yes, but they shouldn't follow the same rules, as public holidays are defined by managers, not by plain users. When adding hr_holidays_public, you can extend the permissions to allow HR managers to set them, but on this base module, only settings users should be able to modify this important information.

Ok, thanks for your advice and clarification. I have updated the permission group on the models of this module.

@pedrobaeza
Copy link
Member

Don't remove the super-menu "Public Holidays". Just host it inside the "Configuration" one. Please keep also the empty lines out.

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-add-calendar_public_holidays branch from 7b016e0 to d54b079 Compare February 13, 2025 11:15
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Thank you!

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-142-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at a958c9b. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit f04ea38 into OCA:18.0 Feb 13, 2025
7 checks passed
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.

5 participants