Skip to content

version-control-platform: add test to show wrong total on org#6

Open
sebastienbeau wants to merge 1 commit into
OCA:18.0from
akretion:18.0-wrong-total-orga
Open

version-control-platform: add test to show wrong total on org#6
sebastienbeau wants to merge 1 commit into
OCA:18.0from
akretion:18.0-wrong-total-orga

Conversation

@sebastienbeau
Copy link
Copy Markdown
Member

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

@etobella
Copy link
Copy Markdown
Member

@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.

@sebastienbeau
Copy link
Copy Markdown
Member Author

@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).
Option 2: Leave this unchanged and extend the logic in the OCA module to address this case.

@etobella
Copy link
Copy Markdown
Member

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?

@sebastienbeau
Copy link
Copy Markdown
Member Author

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

@etobella
Copy link
Copy Markdown
Member

Thanks @sebastienbeau Seems a good approach to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants