Skip to content

[16.0][OU-IMP] base: Review existent states and compare with installed states in order to update them properly#4509

Open
etobella wants to merge 1 commit into
OCA:16.0from
dixmit:16.0-states
Open

[16.0][OU-IMP] base: Review existent states and compare with installed states in order to update them properly#4509
etobella wants to merge 1 commit into
OCA:16.0from
dixmit:16.0-states

Conversation

@etobella

Copy link
Copy Markdown
Member

I think this code could go to all version just us a safety review 😉

@pedrobaeza

@pedrobaeza pedrobaeza changed the title [OU-IMP] base: Review existent states and compare with installed states in order to update them properly [16.0][OU-IMP] base: Review existent states and compare with installed states in order to update them properly Jul 11, 2024
@pedrobaeza pedrobaeza added this to the 16.0 milestone Jul 11, 2024


def _review_states_xmlids(cr):
data_file = open(get_resource_path("base", "data", "res.country.state.csv"), "r")

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.

Add docstring to explain the purpose of this.

ir_model_data imd ON imd.res_id = rc.id
AND imd.model = 'res.country'
AND imd.module = 'base'
WHERE rcs.code = %s AND imd.name = %s

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.

Is imd.name the best option?

@legalsylvain

legalsylvain commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

I think this code could go to all version just us a safety review 😉

If it should go in all versions, maybe better to create an openupgradelib function, and then call it in a single line, in each version. Don't you think ?

marcos-mendez

This comment was marked as spam.

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.

4 participants