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

[17.0][MIG] hr_timesheet_sheet: Migration to 17.0 #687

Merged
merged 232 commits into from
Oct 18, 2024

Conversation

SodexisTeam
Copy link
Member

@SodexisTeam SodexisTeam commented Jun 10, 2024

Superseed #629

@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch 3 times, most recently from 48bdd75 to e0785a9 Compare June 10, 2024 10:50
@SodexisTeam SodexisTeam changed the title 17.0 mig hr timesheet sheet new [17.0][MIG] hr_timesheet_sheet: Migration to 17.0 Jun 10, 2024
@pedrobaeza
Copy link
Member

/ocabot migration hr_timesheet_sheet

Please check CI.

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Jun 10, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 10, 2024
12 tasks
@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch 2 times, most recently from 7108f83 to e952741 Compare June 11, 2024 12:42
vvrossem pushed a commit to vvrossem/timesheet that referenced this pull request Jun 13, 2024
@valentinthirion
Copy link

Hi there,
What is blocking this PR to be merged?
Thanks in advance,
Best regards

OCA-git-bot pushed a commit that referenced this pull request Jun 26, 2024
@valentinthirion
Copy link

Hello,
Can this PR be merged?
Thanks in advance

@vnikolayev1
Copy link

vnikolayev1 commented Aug 16, 2024

Hey @valentinthirion @Vijaiy-Selvaraj , did not see your MR, so made my own on porting to 17
There are two ways to fix your MR:

  1. Please preserve commit history following technical method explained in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0. and do updates that are written in the article
    History of git blame authors should be kept - do the git format-patch - it's hard to review when git history shows that you added all code.
    We should have three commits based on doumentation instructions:
    First commit should be pre-commit fixes
    Second commit should be porting
    Third commit should be your customization

  2. you can pull my code, add your customizations with third commit over my code and i review it [MIG] hr_timesheet_sheet migration to 17.0 #703

I'd rather do second option, because i've done more things on porting/fixing tests due to documentation and commits are already existing, but it's up to you.

@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch from cb9882e to 6952c59 Compare August 20, 2024 05:36
@vnikolayev1
Copy link

@valentinthirion @Vijaiy-Selvaraj @SodexisTeam are you still interested in review? :)

@SodexisTeam
Copy link
Member Author

@vnikolayev1 We took care of the improvements. Please review it.

@vnikolayev1
Copy link

vnikolayev1 commented Aug 22, 2024

@SodexisTeam Overall porting to 17 looks good after we fix this _check_can_write method , please make migration as 3 commits like in this instruction
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0.
1st commit you move v16 to v17 with format-patch and do pre-commit (you do pre-commit, than git add everything back what was changed by pre commit than push)
2nd commit should be your port to v17 (run it through pre-commit and do git add)
3rd commit should be your improvements with _check_can_write and report (run it through pre-commit and do git add)

I'll make my MR to yours after that

@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch from 157bde4 to cc258a0 Compare August 23, 2024 13:11
@SodexisTeam
Copy link
Member Author

@vnikolayev1 We took care of the changes. Please review it.

@vnikolayev1
Copy link

vnikolayev1 commented Aug 27, 2024

@SodexisTeam Look good, gave another review, Let's wrap it up:

  1. Can you please give steps to reproduce _check_can_write bug so I'll check it?
  2. Please squash my test fix and suggestions into migration commit (run pre-commit on it)
    Let's add our companies so they will be motivated to contribute to OCA

@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch from cc258a0 to f7d9b26 Compare August 29, 2024 07:55
@SodexisTeam
Copy link
Member Author

@vnikolayev1 Took care of the changes.

Here is the steps to reproduce _check_can_write bug:

  1. Ensure the "project_timesheet_holidays" module is installed.
  2. Comment out the "_check_can_write" method in the "account_analytic_line.py" file under the "hr_timesheet_sheet" module.
  3. Create a time off request for an employee with a time off type that has "Generate Timesheets" enabled, and approve it.
  4. When creating a timesheet for the same employee, if the time off date falls within the timesheet date range, you will encounter a UserError stating: "You cannot modify timesheets that are linked to time off requests. Please use the Time Off application to modify your time off requests instead."

@vnikolayev1
Copy link

vnikolayev1 commented Aug 29, 2024

Thank you, will check tomorrow, found another bug on name renderingб added to suggestions:
hr_timesheet_sheet/models/hr_timesheet_sheet.py line 231

@vnikolayev1
Copy link

vnikolayev1 commented Aug 30, 2024

Hmm, i see no errors after doing this.

  1. Made sure project_timesheet_holidays is installed and commented out _check_can_write function in
  2. Took paid off dayoff
    image
    image

and took it for one day
image
3. added timesheet in analytic account on the same date Menu > Timesheets > All timesheets
image
The only value that going through this method is {'amount': -100.0} , no sheet_id, that's why i thought that this method is kind of sketchy.
Also hasattr(self, "holiday_id") will always be true because we have project_timesheet_holidays module installed
P.S. I only have our modules installed, maybe something else in your project breaks this logic?

@vnikolayev1
Copy link

@SodexisTeam any thoughts?

@SodexisTeam
Copy link
Member Author

@vnikolayev1

I have attached the error simulation video for your reference.
Please ensure that the instruction to comment out the _check_can_write method in the account_analytic_line.py file under the hr_timesheet_sheet module has been followed.

Hr_Timesheet_User_Error.webm

@pedrobaeza
Copy link
Member

Please include #712

jakobkrabbe and others added 20 commits October 18, 2024 17:03
Currently translated at 99.4% (180 of 181 strings)

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/sv/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/
Currently translated at 100.0% (183 of 183 strings)

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/it/
Currently translated at 82.5% (151 of 183 strings)

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/pt/
Currently translated at 84.1% (154 of 183 strings)

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/pt/
Currently translated at 100.0% (183 of 183 strings)

Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_sheet
Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_sheet/pt_BR/
Fixes inability to add lines to timesheets that containstime off lines,
managed from project_timesheet_holidays.

Fixes OCA#711
@SodexisTeam SodexisTeam force-pushed the 17.0-mig-hr_timesheet_sheet_new branch from 8402fe8 to 9cee80f Compare October 18, 2024 14:38
@SodexisTeam
Copy link
Member Author

@pedrobaeza

Sorry for the inconvenience caused.
We ensured that the latest commits of V16 are included in the V17 migrations.
Thanks

@pedrobaeza
Copy link
Member

I was talking about squash administrative commits

https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests

but OK, let's merge this.

Please check the procedure about this next time, and please do commits with an individual login.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-687-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 14108f1 into OCA:17.0 Oct 18, 2024
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@odoo-sh
Copy link

odoo-sh commented Oct 18, 2024

@pedrobaeza sorry for the trouble and thanks for the comments. I think we are going to follow your advice and start using individual account, it seemed easier when we started. Thanks.

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.