version-control-platform: add test to show wrong total on org#6
version-control-platform: add test to show wrong total on org#6sebastienbeau wants to merge 1 commit into
Conversation
|
@sebastienbeau this is expected. We akready comented that we don't know the real organization of a user, so the only solution was to handle like received comments. |
|
@etobella For the OCA ERP statistics, since we know the actual member organization, which do you prefer: Option 1: Modify the logic here to include the partner’s parent, with additional logic to handle historical changes (e.g., a person switching companies). |
|
Probably 2 is the best one. However, how will you handle that a user changes of organization? all of his reviews will pass to the new one? |
|
My idea is to store the company that "own" the review/comment on the review/comment (with a computed store field). If somebody change of company (we will have a historical table to store the information of the previous company) we can assign the right company on the review/comment. So if Yannick was at C2C on 2024 the review and comment will be assigned to C2C. Then in 2025 it will be assigned to Acsone. Ok I go for option 2 |
|
Thanks @sebastienbeau Seems a good approach to me. |
Hi @etobella
The total on the partner company are not correct. Right now if a user from ORG 2 add a comment on a PR open by the ORG 1 the statistic will be counted for the ORG 1.
For now I just have added a test to show you the issue.
To fix it I propose:
adding a o2m on the res.partner to be able to store the historical company of a res.partner (with a table res.partner.history with start_date, end_date, company_id)
adding a computing field on the vcp.review / vcp.comment to compute the related company
For simple case the company of the partner is simply the parent_id of the partner that have done the contribution, in some advanced case (like Yannick Payot who was working at Camptocamp and then as Ascone) we can use the historical company mapping to be able to set the right company on the contribution.
What do you think ? If it's ok I will do it