Skip to content

Commit

Permalink
[FIX] Add hr_timesheet_begin_end to rebel modules
Browse files Browse the repository at this point in the history
This is a tricky one. _Technically_ there is nothing that makes
hr_timesheet_begin_end incompatible with the other modules here.
However, when the project_id on a timesheet line is changed, unit_amount
is rerecomputed. This has some consequences.

In the sale_timesheet tests, the project_id of a timesheet line
is (sometimes?) recomputed. Subsequently, unit_amount is recomputed and
set to 0 when it _shouldn't_ be. Under a normal flow this wouldn't be a
problem; time_start and time_stop would be populated to correctly
recompute unit_amount. But in the tests, they are not.

One solution is to, in addition to not recomputing the unit_amount of
non-timesheet lines, not recompute the unit_amount of timesheet lines
whose time_start and time_stop are both set to 00:00. However, this
means that resetting these values to 00:00 does not correctly set
unit_amount back to 0, which seems erroneous to me.

Marking this module as a rebel module seems like the best course of
action to me, even though it would be preferable to test this in
conjunction with the other modules.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed Jun 28, 2024
1 parent 55c67c2 commit b601c05
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.21.1
_commit: '1.23'
_src_path: gh:oca/oca-addons-repo-template
ci: GitHub
convert_readme_fragments_to_markdown: false
Expand All @@ -17,6 +17,7 @@ org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups:
- sale_timesheet_rounded
- hr_timesheet_begin_end
repo_description: 'TODO: add repo description.'
repo_name: timesheet
repo_slug: timesheet
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,25 @@ jobs:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
include: "sale_timesheet_rounded"
makepot: "true"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
include: "sale_timesheet_rounded"
name: test with OCB
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
exclude: "sale_timesheet_rounded"
include: "hr_timesheet_begin_end"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
include: "hr_timesheet_begin_end"
name: test with OCB
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
exclude: "sale_timesheet_rounded,hr_timesheet_begin_end"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
exclude: "sale_timesheet_rounded"
exclude: "sale_timesheet_rounded,hr_timesheet_begin_end"
name: test with OCB
makepot: "true"
services:
postgres:
image: postgres:12.0
Expand Down Expand Up @@ -79,9 +86,5 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Update .pot files
run:
oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN
}}@github.com/${{ github.repository }}
if:
${{ matrix.makepot == 'true' && github.event_name == 'push' &&
github.repository_owner == 'OCA' }}
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ var/
*.egg
*.eggs

# Debian packages
*.deb

# Redhat packages
*.rpm

# MacOS packages
*.dmg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down

0 comments on commit b601c05

Please sign in to comment.