-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
[12.0][FIX] base: don't create user_admin if already exists #1779
[12.0][FIX] base: don't create user_admin if already exists #1779
Conversation
Use |
9d8a0b5
to
b182933
Compare
Done |
But the question in the issue remains: if this is not added by core, if we do this, the record can point to other thing that it's not even the same model. |
Agreed. Would be very interesting to know how this xml entry ended up there. Was it an earlier, failed run of the pre migration script? (but the rest of the script does not look reentrant either) |
@mreficent can you answer? |
No idea. @yann-papouin or @kenji-autotest should answer haha |
OK, then unless we demonstrate this is a real issue, this doesn't serve, and starting to put safeguards everywhere is not the best option IMO. |
I believe this happened due to #1879, so closing for now while not proofs about it. |
I happened to meet a database that already have an |
@mreficent I don't think so. Maybe there was an error in the middle of your migration and thus end-migration scripts weren't executed. |
No. I am sure. The xmlid |
Unless you prove it pointing to the core code that makes this, for me it's 👎 |
Found 🤣 🎉. Around between v5 and v6, I think, not sure. Also, I will show you my proof: So I will merge this PR! |
b182933
to
e982d08
Compare
This is the result of not cleaning your DB with database_cleanup, not a normal process IMO. You should care about your data status that way. And you are not sure about where that record points to. And what about if other third party module adds that record and you are overwriting it for other purpose? Let's hear @StefanRijnhart's opinion about this, but any way, if merged:
|
c6dbb08
to
4acd1e7
Compare
I decided to use the "ON CONSTRAINT" mode to be more specific and avoid unexpected cases and be safer 😉 |
My concern about overwriting an existing third party XML-ID still exists... Why don't you simply remove that XML-ID in your specific database. |
4acd1e7
to
30b1a7e
Compare
Third party XML-ID will not be affected because they will have a different module, not the "base" module. |
You can declare that XML-ID from another module, but OK, I won't say more objections. Waiting @StefanRijnhart's approval. |
Interestingly the tests say |
I searched a bit. This constraint existed in v8 but was removed in v9. In my force-push, I just put it because I was just having in front of me a database with that constraint and I thought it was a normal constraint. Shit. |
c1c3337
to
8dfba00
Compare
Well, I proceeded finally with the most safely way possible hahaha Please, update review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright!
I still miss the explanation in a comment in the code of why doing all of this. |
8dfba00
to
b00e1ce
Compare
/ocabot merge |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at d2c1810. Thanks a lot for contributing to OCA. ❤️ PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into |
Fixes #1766
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr