[FIX] base_multi_image: Use env in uninstall_hook#677
[FIX] base_multi_image: Use env in uninstall_hook#677StefanRijnhart merged 4 commits intoOCA:10.0from
Conversation
* Uninstall hook should use new API instead of old, which doesn’t exist anymore
base_multi_image/hooks.py
Outdated
| Image.unlink(cr, SUPERUSER_ID, ids) | ||
| env = api.Environment(cr, SUPERUSER_ID, dict()) | ||
| Image = env["base_multi_image.image"] | ||
| ids = Image.search(env, [("owner_model", "=", model)]) |
There was a problem hiding this comment.
Better to call the variable records or recs
|
What is the value of the argument |
|
@pedrobaeza Registry is valid, I just figured that while the env was there I should use it. Is that not the case? |
|
The real error I am circumventing is the |
|
Have you tried to use directly |
|
Yeah but an environment is still required as the first argument, so I don't see the different from just using the environment itself. Both of these work: But the former seems cleaner and more OOP IMO I am about to double check all of this in a new install though just to make sure |
|
OK, thanks for the tests. |
|
Hmmm yeah ok so that worked too, without the env. In hindsight I'm actually not sure why it worked the first time around when I passed an env to the Simplified version, which I'm pretty sure is what you were thinking of, is pushed. Confirmed it works too 😄 |
pedrobaeza
left a comment
There was a problem hiding this comment.
Yeah, indeed that was my idea.
To the merger: please squash on merge
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
Syncing from upstream OCA/server-tools (12.0)
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
* [FIX] base_multi_image: Use env in uninstall_hook
This should fix the Travis fails in OCA/product-attribute#201