timesheet icon indicating copy to clipboard operation
timesheet copied to clipboard

[18.0][FIX] project_task_analytic_propagation: recompute billed

Open sabrinaRMartin opened this issue 3 months ago • 9 comments

MT-11484

@moduon @Andrii9090 @rafaelbn

https://github.com/OCA/timesheet/pull/815 migrated to 18.0

https://www.loom.com/share/dfdaf17385ac4c428c4e015a1afa9638?sid=6b3750fd-eb96-4a24-bc5c-9ebb0aaab49b

sabrinaRMartin avatar Sep 22 '25 14:09 sabrinaRMartin

Hi @rafaelbn, @Andrii9090, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Sep 22 '25 14:09 OCA-git-bot

Functional test after some changes https://www.loom.com/share/0e1da224b65440b89999cb364709ebd7?sid=eec0b907-ff99-4d7c-a5d8-8592391e9742

Andrii9090 avatar Oct 23 '25 08:10 Andrii9090

Functional test after some changes https://www.loom.com/share/0e1da224b65440b89999cb364709ebd7?sid=eec0b907-ff99-4d7c-a5d8-8592391e9742

I've tested this and it works correctly, good job @Andrii9090 !! 😄

imagen imagen imagen

sabrinaRMartin avatar Oct 23 '25 09:10 sabrinaRMartin

Things I miss, apart from the inline comments below:

  1. Video demonstrating that migration scripts work as expected.
  2. New tests for this new feature, apart from fixing the old tests.

Thanks!

Thank you! I'm going to record a video with migration script tests soon.

Andrii9090 avatar Oct 24 '25 16:10 Andrii9090

@yajo I updated this PR and recorded a short video demonstrating the migration script tests. Can you review? https://www.loom.com/share/dd4d99c802a94cd988a2ed3b051bd9a1

Thanks :heart:

Andrii9090 avatar Oct 27 '25 09:10 Andrii9090

@yajo @chienandalu cam you review again? I’ve updated the logic — we no longer use the compute method of account.analytic.line. Instead, I modified the _timesheet_preprocess_get_accounts method, which Odoo calls every time an account.analytic.line record is created or updated.

Thanks!

Andrii9090 avatar Nov 04 '25 09:11 Andrii9090

Hi, @Gelojr. I’ve updated the code in this module. Can you review it again? If the SO line is changed, the timesheet line continues to have the same analytical accounts. Before change SO image After change SO image

Andrii9090 avatar Nov 10 '25 16:11 Andrii9090

I changed the code, and now we can propagate analytic accounts to all timesheets.

image

After change the task analytic accounts and timesheets SO lines image

Andrii9090 avatar Nov 14 '25 08:11 Andrii9090

@Gelojr I fixed this bug https://www.loom.com/share/35dec2ccab6b43f0b1d9dfa2eb44e601

Andrii9090 avatar Nov 18 '25 09:11 Andrii9090

@Gelojr thank you! This is expected behaviour. Now it does not matter whether the timesheet has a sale order item or not, whether it is edited or not. In any case, we propagate the analytic accounts from the task. Can you review again?

Andrii9090 avatar Nov 24 '25 08:11 Andrii9090

/ocabot merge patch

rafaelbn avatar Nov 28 '25 12:11 rafaelbn

This PR looks fantastic, let's merge it! Prepared branch 18.0-ocabot-merge-pr-819-by-rafaelbn-bump-patch, awaiting test results.

OCA-git-bot avatar Nov 28 '25 12:11 OCA-git-bot

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

OCA-git-bot avatar Nov 28 '25 13:11 OCA-git-bot