Skip to content

[20.0][FIX] upgrade_analysis: take merged models into account for comparing xmlids - #3869

Open
hbrunn wants to merge 2 commits into
OCA:20.0from
hbrunn:20.0-upgrade_analysis-use-model_map
Open

hbrunn wants to merge 2 commits into
OCA:20.0from
hbrunn:20.0-upgrade_analysis-use-model_map

Conversation

@hbrunn

@hbrunn hbrunn commented Nov 18, 2026

Copy link
Copy Markdown
Member

this will lead to entries like

ir.access: base.properties_base_definition_rule_admin (noupdate switched)
ir.access: base.res_company_rule_erp_manager (noupdate switched)
ir.access: base.res_company_rule_public (noupdate switched)
ir.access: base.res_currency_rate_rule (noupdate switched)
ir.access: base.res_partner_bank_rule (noupdate switched)
NEW ir.access: base.res_partner_bank_rule_user
NEW ir.access: base.res_partner_bank_rule_user_1
ir.access: base.res_partner_portal_public_rule (noupdate switched)
ir.access: base.res_partner_rule (noupdate switched)
NEW ir.access: base.res_partner_rule_edit_all
NEW ir.access: base.res_partner_rule_user
NEW ir.access: base.res_partner_rule_write_self
ir.access: base.res_users_identity_check (noupdate switched)
ir.access: base.res_users_log_rule (noupdate switched)
ir.access: base.res_users_rule (noupdate switched)

not great, but something we can live with I think

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @StefanRijnhart, @legalsylvain,
some modules you are maintaining are being modified, check this out!

@StefanRijnhart StefanRijnhart left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So module_rename_map which is now unused caused entries to show up as both NEW and DEL if model changed. Not a great loss but in general (not sure about current accessocalypse) it would be nice to have the data entry indicate the model switch. Would that be possible?

@hbrunn

hbrunn commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

thanks, I'll remove the unused function. But I don't think I get the second part. Isn't it a feature that we don't see records with the same xmlid? For the ir.access case, that's mainly meant to remove noise, we don't even actually merge those models in the base migration.

I attach the full upgrade_analysis.txt file this creates, which does what I'd like: no entry for ie. access_decimal_precision_config which was a ir.model.access record, DEL entries for ir.rule and ir.model.access records that don't have an ir.access counterpart with the same xmlid and the noupdate switched entries from former ir.rule records would be important to handle if we actually merged those models, so this entries should stay and we have to live with them for the ir.access case.

@StefanRijnhart

Copy link
Copy Markdown
Member

Yes, I understand that this works well in this particular case, when the model switch is global, expected and predictable. But in case of a one off, it would be really useful to be aware when writing the migration script (which the previous version did not do well either, but at least the combined NEW + DEL would attract attention).

E.g.

ir.access: base.ir_filters_portal_public_rule (noupdate switched, previous model ir.rule)

Again, mass model name rewrites such as this one are probably better off filtered out by the mechanism but you get the idea. Happy to approve this version if you think it's too rare.

@hbrunn
hbrunn force-pushed the 20.0-upgrade_analysis-use-model_map branch from 4046a99 to 1ab31f9 Compare November 24, 2026 05:52
@hbrunn

hbrunn commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

thanks for the elaboration @StefanRijnhart, I took the liberty to a small refactoring to make it look exactly as you propose

@StefanRijnhart StefanRijnhart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thanks!

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