Skip to content

Conversation

@etobella
Copy link
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
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
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
Copy link
Contributor

legalsylvain commented Jul 11, 2024

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 ?

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.

3 participants