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] resource_work_time_from_contracts #302

Merged
merged 17 commits into from
Dec 19, 2023

Conversation

victor-champonnois
Copy link
Member

@victor-champonnois victor-champonnois commented Jul 20, 2023

@huguesdk I have one failing test and I can't make it work. Also I am not sure about commit eca1800.
Could you help ?

The error happens for test_with_leaves

When I stop at line

and do self.list_leaves(from_datetime,to_datetime)

0:
(datetime.date(2021, 10, 26), 1.8, resource.calendar.leaves(81,))
1:
(datetime.date(2021, 10, 26), 1.0, resource.calendar.leaves(81,))
2:
(datetime.date(2021, 10, 27), 1.8, resource.calendar.leaves(82,))
3:
(datetime.date(2021, 10, 29), 1.8, resource.calendar.leaves(83,))
4:
(datetime.date(2021, 10, 29), 3.8, resource.calendar.leaves(83,))

Alors qu'en 12 j'obtiens :

0:
(datetime.date(2021, 10, 26), 3.8, resource.calendar.leaves(10,))
1:
(datetime.date(2021, 10, 27), 3.8, resource.calendar.leaves(11,))
2:
(datetime.date(2021, 10, 29), 3.8, resource.calendar.leaves(12,))
3:
(datetime.date(2021, 10, 29), 3.8, resource.calendar.leaves(12,))
```

normal_work_time_per_day est OK. 

task : https://gestion.coopiteasy.be/web#id=10959&action=475&active_id=492&model=project.task&view_type=form&menu_id=

@victor-champonnois victor-champonnois changed the title 16.0 mig resource work time from contracts [16.0] mig resource_work_time_from_contracts Jul 20, 2023
@victor-champonnois victor-champonnois changed the title [16.0] mig resource_work_time_from_contracts [16.0] [MIG] resource_work_time_from_contracts Jul 20, 2023
Copy link
Member

@carmenbianca carmenbianca left a comment

Choose a reason for hiding this comment

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

Some small comments.

Will also look at the failing test.

def get_work_days_data(
def _get_work_days_data_batch(
Copy link
Member

Choose a reason for hiding this comment

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

Per the commit message, which indirectly links to odoo/odoo#56477, I think this change (and all other changes in the commit 7bbb859) should be squashed into the 13.0 migration commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@carmenbianca
Copy link
Member

Patched up the failing test. Please remove the reverted commit (and the revert commit) before merging. I kept them for history's sake.

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Merging #302 (c4937d6) into 16.0 (b640076) will decrease coverage by 0.15%.
The diff coverage is 97.45%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             16.0     #302      +/-   ##
==========================================
- Coverage   97.73%   97.59%   -0.15%     
==========================================
  Files          12       21       +9     
  Lines         221      457     +236     
  Branches       30       51      +21     
==========================================
+ Hits          216      446     +230     
- Misses          1        4       +3     
- Partials        4        7       +3     
Files Changed Coverage Δ
..._work_time_from_contracts/models/resource_mixin.py 92.77% <92.77%> (ø)
resource_work_time_from_contracts/__init__.py 100.00% <100.00%> (ø)
...source_work_time_from_contracts/models/__init__.py 100.00% <100.00%> (ø)
..._from_contracts/models/resource_calendar_leaves.py 100.00% <100.00%> (ø)
...rk_time_from_contracts/models/resource_resource.py 100.00% <100.00%> (ø)
...esource_work_time_from_contracts/tests/__init__.py 100.00% <100.00%> (ø)
...k_time_from_contracts/tests/test_work_days_data.py 100.00% <100.00%> (ø)
...e_work_time_from_contracts/tests/test_work_time.py 100.00% <100.00%> (ø)
...k_time_from_contracts/tests/test_work_time_base.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@victor-champonnois victor-champonnois force-pushed the 16.0-mig-resource_work_time_from_contracts branch 2 times, most recently from c4937d6 to adea1ca Compare September 11, 2023 09:45
@victor-champonnois victor-champonnois marked this pull request as ready for review September 11, 2023 09:46
@victor-champonnois
Copy link
Member Author

thanks a lot carmen !

@robinkeunen
Copy link
Member

/ocabot rebase

huguesdk and others added 15 commits December 19, 2023 14:47
* override resource.mixin.get_work_days_data() to also take contracts
  into account. this is used for example by the hr_holidays module to
  compute leave days.
* force employees' working hours to be equal to the company's working
  hours.
* hide the working hours field on the employee form view.
hide working time column from resource list view.
* fix work time computation with existing leaves.
* add .list_normal_work_time_per_day() method to compute work time
  ignoring leaves.
* fix timezone issues.
force leaves to use the resource calendar of the company. to compute
working hours while taking leaves into account, this module requires
that all leaves for all resources are defined in the same resource
calendar.
Signed-off-by: Carmen Bianca Bakker <[email protected]>
Signed-off-by: Carmen Bianca Bakker <[email protected]>
[FIX] rename get_work_days_data to _get_work_days_data_batch

following this commit OCA/OCB@8c96a88
@github-grap-bot
Copy link
Contributor

Congratulations, PR rebased to 16.0.

@github-grap-bot github-grap-bot force-pushed the 16.0-mig-resource_work_time_from_contracts branch from adea1ca to 4503e9f Compare December 19, 2023 14:47
@robinkeunen
Copy link
Member

/ocabot merge nobump

@github-grap-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-302-by-robinkeunen-bump-nobump, awaiting test results.

@github-grap-bot github-grap-bot merged commit 66846f7 into 16.0 Dec 19, 2023
2 checks passed
@github-grap-bot github-grap-bot deleted the 16.0-mig-resource_work_time_from_contracts branch December 19, 2023 15:02
@github-grap-bot
Copy link
Contributor

Congratulations, your PR was merged at 5abf60e. Thanks a lot for contributing to coopiteasy. ❤️

@github-grap-bot
Copy link
Contributor

@robinkeunen The merge process could not be finalized because an exception was raised: 500 [No message].

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.

6 participants