Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] google_calendar: migration script #3489

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

MiquelRForgeFlow
Copy link
Contributor

Supersedes #3407.

@MiquelRForgeFlow MiquelRForgeFlow added this to the 15.0 milestone Jul 28, 2022
@pedrobaeza
Copy link
Member

Mixed of modules

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Jul 28, 2022

I know, but I was too lazy to do another PR.

@pedrobaeza
Copy link
Member

Please do it in this case for not mixing things.

GREATEST(ru.write_uid, ct.write_uid),
GREATEST(ru.create_date, ct.create_date),
GREATEST(ru.write_uid, ct.write_uid),
GREATEST(ru.write_date, ct.write_date),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naive question.

If I understand correctly
before your commit :

  • crm_team.create_date -> crm_team_member.create_date
  • crm_team.create_uid -> crm_team_member.create_uid
  • crm_team.write_date -> crm_team_member.write_date
  • crm_team.write_uid -> crm_team_member.write_uid

With your commit

  • crm_team.write_date -> crm_team_member.create_date
  • crm_team.write_uid -> crm_team_member.create_uid
  • crm_team.write_date -> crm_team_member.write_date
  • crm_team.write_uid -> crm_team_member.write_uid

why not conserve create information ?

Copy link
Contributor Author

@MiquelRForgeFlow MiquelRForgeFlow Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that's something I realized, I think it's the best approach. How to explain... Well, it happens that the model crm.team.member with table crm_team_member it's also a m2m table for field crm_team_ids of res.users. So, who created the user or who created the team maybe not who added the user as a team member of the team. The same for date. Maybe I am wrong, but I thought that adding the write_uid instead is less wrong: who can modify a team or modify the user is more probably to also be who adds the user as a team member.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think neither of the approaches will be accurate, so better to leave it as it was

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean, to leave them without uids and dates?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation @MiquelRForgeFlow.

I abstain on that point, I don't know what is the best approach.

to leave them without uids and dates?

i remember a case, when having empty create date / uid was a problem. In recent odoo version, the fied are filled, but as my database comes from a V5, some values was absent. So once I had to write (pseudo) update xxx set create_date = write date where create_date is null. But I don't remember exactly the context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean to leave it as it was. And the end, this is merely information not tied to business logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, the PR is in #3490. I will think about it a bit more. All options are bad, but I will try to find the "less" bad one. If not, I will close it.

@MiquelRForgeFlow MiquelRForgeFlow merged commit cc4ab2a into OCA:15.0 Jul 28, 2022
@MiquelRForgeFlow MiquelRForgeFlow deleted the v15_mig_google_calendar branch July 28, 2022 09:29
@MiquelRForgeFlow
Copy link
Contributor Author

/ocabot migration google_calendar

@OCA-git-bot
Copy link
Contributor

The migration issue (#3287) has been updated to reference the current pull request.
however, a previous pull request was referenced : #3407.
Perhaps you should check that there is no duplicate work.
CC : @duong77476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants