[18.0][FIX] project_task_analytic_propagation: recompute billed
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
Hi @rafaelbn, @Andrii9090, some modules you are maintaining are being modified, check this out!
Functional test after some changes https://www.loom.com/share/0e1da224b65440b89999cb364709ebd7?sid=eec0b907-ff99-4d7c-a5d8-8592391e9742
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 !! 😄
Things I miss, apart from the inline comments below:
- Video demonstrating that migration scripts work as expected.
- 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.
@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:
@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!
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
After change SO
I changed the code, and now we can propagate analytic accounts to all timesheets.
After change the task analytic accounts and timesheets SO lines
@Gelojr I fixed this bug https://www.loom.com/share/35dec2ccab6b43f0b1d9dfa2eb44e601
@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?
/ocabot merge patch
This PR looks fantastic, let's merge it! Prepared branch 18.0-ocabot-merge-pr-819-by-rafaelbn-bump-patch, awaiting test results.
Congratulations, your PR was merged at 511cb1065b23c832f67348628033efca3b15cbdf. Thanks a lot for contributing to OCA. ❤️