Skip to content
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

[FIX] project: Deal with forcecreate=False records #1063

Closed

Conversation

pedrobaeza
Copy link
Member

Let's see if we have all the cases covered. I have included a test for that.

cc @Tecnativa

@pedrobaeza
Copy link
Member Author

@mreficent this is what I was talking about on the other PR, but I decided to do it myself as I don't have it clear that everything is going to be correct.

@hbrunn my fear with mode='update' is that we don't get updated the rest of the existing records.

@hbrunn
Copy link
Member

hbrunn commented Sep 6, 2017

I tried this yesterday but mode=update didn't work, because of https://github.com/OCA/OCB/blob/10.0/odoo/addons/base/ir/ir_model.py#L1212 - we have an xmlid, so this will act just the same. Haven't found a good solution yet.

@pedrobaeza
Copy link
Member Author

I think we need to modify the core..

@hbrunn
Copy link
Member

hbrunn commented Sep 6, 2017

I'd rather not do anything at all with those records as far as xml files are concerned, and do conditional writes in python code where necessary. We're talking about a couple of records per release, right?

@pedrobaeza
Copy link
Member Author

Well the pity is to not have an standard way to do it. Maybe what we can do is to filter out the non existing records in openupgradelib method.

@pedrobaeza
Copy link
Member Author

You know: if you don't have it automated, for sure we will have problems in the future when we forget to do the specific thing.

@hbrunn
Copy link
Member

hbrunn commented Sep 6, 2017

sure, standard ways are better. If you want to commit time to this, perfect. Otherwise, we'll better revert the commit loading this for the project migration, as I believe real world databases tend to have the record deleted

@hbrunn
Copy link
Member

hbrunn commented Oct 3, 2017

@pedrobaeza this PR works with OCA/openupgradelib#80

@hbrunn
Copy link
Member

hbrunn commented Oct 5, 2017

@pedrobaeza as of OCA/openupgradelib#80, you'll have to pass mode='init_no_create'

@StefanRijnhart
Copy link
Member

Did you consider leaving out the noupdate entries from the project module in 10 that only disable the earlier forcecreate=False items from 9.0? If the migrated database is from Odoo 8.0 the entries won't exist (which causes the problem you are trying to solve here) and if the database was installed from version 9.0 the entries will have been cleaned up or reused(!) during the 9.0 lifecycle by the customer.

@StefanRijnhart
Copy link
Member

As per my previous comment I am proposing #1124

@StefanRijnhart
Copy link
Member

After the merge of #1124, this is no longer needed I believe.

@pedrobaeza
Copy link
Member Author

Well, yes, but I still want to try the test.

@pedrobaeza
Copy link
Member Author

Uhm, strange error, but anyway tests are correct. I close this PR then.

@pedrobaeza pedrobaeza closed this Oct 10, 2017
@pedrobaeza pedrobaeza deleted the 10.0-project-noupdate_forcecreate branch October 10, 2017 14:28
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