From b601c05f1a4b6ec0408cdddc306090b44f11ff80 Mon Sep 17 00:00:00 2001 From: Carmen Bianca BAKKER Date: Fri, 28 Jun 2024 14:45:06 +0200 Subject: [PATCH] [FIX] Add hr_timesheet_begin_end to rebel modules 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 --- .copier-answers.yml | 3 ++- .github/workflows/test.yml | 21 ++++++++++++--------- .gitignore | 9 +++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index fd762c0179..e3f412721a 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -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 @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bad198c1f..9f621e11c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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' }} diff --git a/.gitignore b/.gitignore index 0090721f5d..2b045db399 100644 --- a/.gitignore +++ b/.gitignore @@ -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