[18.0][OU-ADD] fleet: Migration to 18.0#5310
Conversation
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
LGTM, just a minor change for a more detailed explanation of the work done.
7abe774 to
f4cc436
Compare
|
/ocabot migration fleet |
f4cc436 to
29b05f8
Compare
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
If you want to be sure it also covers cases where the value is NULL or 0, you could use COALESCE, but LGTM.
TT54429
@pedrobaeza @MiquelRForgeFlow could you please review this?
29b05f8 to
169452e
Compare
| ), | ||
| ] | ||
| ) | ||
| data.unlink() |
There was a problem hiding this comment.
Why don't you use delete_records_safely_by_xml_id that tries to remove data if not used, or the XML-ID if not able to remove?
There was a problem hiding this comment.
I did it like that first but then @MiquelRForgeFlow thought that it was better to keep the models even if not used. I tend to agree it should be the decision of the user not the migration script to remove or keep models.
There was a problem hiding this comment.
Also side technical question : delete_records_safely_by_xml_id does not remove the XML-ID but change it to no-update if unable to unlink the record. Why not delete the XML-ID ?
There was a problem hiding this comment.
it was better to keep the models
In fact, Odoo didn't delete them. They moved them to demo data.
There was a problem hiding this comment.
Yeah, but in a practical side, they are not there on non demo databases, so trying to removing them is the logical way to handle it. Users may not remove them because they don't know they can.
There was a problem hiding this comment.
Suppose that from those vehicle models, you used 3. Thus, following you rationale, the other vehicle models would be deleted except those 3. It doesn't make much sense. Or you have them all, or you remove them all.
There was a problem hiding this comment.
Well, I see it as the correct behavior
There was a problem hiding this comment.
That's a personal point of view, not necessary the "correct" behavior, right? In this case, I believe there doesn't exist a "true correct one" behavior, and thus, I believe we should respect the option the author of this PR chooses.
Also side technical question : delete_records_safely_by_xml_id does not remove the XML-ID but change it to no-update if unable to unlink the record. Why not delete the XML-ID ?
BTW, the use of delete_records_safely_by_xml_id in this case would be incorrect, as it doesn't delete the model data:

🤔 Maybe we should create another method where the exception is:
imd.unlink() instead of imd.noupdate = true.
There was a problem hiding this comment.
if we look it in a positive way meaning user are well enough savy with Odoo to archive/delete model they don't use then they can do the cleaning themself if they want/need to.
Also there is a menu entry (not in technical) to open models (tree, form, search view and all) so we might imagine someone is using this natively without linking models to vehicles but just do do statistics or something. We can also thing about customizations that might use models do do other things that might lead to bad outcome if we "safely" delete them.
I know this is far stretched and it was certainly a mistake made by odoo to have these models in module data and not in demo data.
My opinion is to keep them :)
There was a problem hiding this comment.
OK, I think the usage of this module is niche, so it won't affect too much. Let's continue!
169452e to
5479a96
Compare
No description provided.