[10.0][FIX] base_multi_image: Uninstall hook#709
Merged
pedrobaeza merged 3 commits intoOCA:10.0from Jan 23, 2017
Merged
Conversation
* Fix registry usage in uninstall hook
* Use env in uninstall hook
5 tasks
guewen
approved these changes
Jan 23, 2017
base_multi_image/hooks.py
Outdated
| Image = registry["base_multi_image.image"] | ||
| images = Image.search([("owner_model", "=", model)]) | ||
| images.unlink() | ||
| env = api.Environment(cr, SUPERUSER_ID, dict()) |
Member
There was a problem hiding this comment.
nitpicking: why dict() rather than {}?
Contributor
Author
There was a problem hiding this comment.
Admittedly, laziness. I copied this from the env creation above instead of typing the ever so many characters 😉
Good nitpick though, dict() is totally not pythonic - and actually I think slightly less efficient due to method call.
pedrobaeza
approved these changes
Jan 23, 2017
qtheuret
pushed a commit
to qtheuret/server-tools
that referenced
this pull request
Jun 12, 2018
qtheuret
pushed a commit
to qtheuret/server-tools
that referenced
this pull request
Jun 12, 2018
qtheuret
pushed a commit
to qtheuret/server-tools
that referenced
this pull request
Jun 12, 2018
hugosantosred
pushed a commit
to factorlibre/server-tools
that referenced
this pull request
Aug 20, 2018
devang-dreambits
pushed a commit
to devang-dreambits/server-tools
that referenced
this pull request
Mar 4, 2019
angelmoya
pushed a commit
to PESOL/server-tools
that referenced
this pull request
Mar 7, 2019
javierjcf
pushed a commit
to Comunitea/server-tools
that referenced
this pull request
Sep 9, 2020
hailangvn
pushed a commit
to hailangvn/server-tools
that referenced
this pull request
May 16, 2021
TobiasSorg
pushed a commit
to AmetrasIntelligence/server-tools
that referenced
this pull request
Nov 26, 2021
hailangvn
pushed a commit
to hailangvn/server-tools
that referenced
this pull request
Jan 24, 2022
flachica
pushed a commit
to flachica/server-tools
that referenced
this pull request
May 6, 2022
flachica
pushed a commit
to flachica/server-tools
that referenced
this pull request
May 6, 2022
flachica
pushed a commit
to flachica/server-tools
that referenced
this pull request
May 17, 2022
mtelahun
pushed a commit
to mtelahun/server-tools
that referenced
this pull request
Sep 5, 2022
clb-openfire
pushed a commit
to odof/server-tools
that referenced
this pull request
Apr 4, 2023
yibudak
pushed a commit
to yibudak/server-tools
that referenced
this pull request
Apr 26, 2023
Ricardoalso
pushed a commit
to camptocamp/server-tools
that referenced
this pull request
Sep 19, 2023
omalbastin
pushed a commit
to omalbastin/server-tools
that referenced
this pull request
Jan 5, 2024
IJOL
pushed a commit
to BITVAX/server-tools
that referenced
this pull request
Aug 9, 2024
IJOL
pushed a commit
to BITVAX/server-tools
that referenced
this pull request
Aug 19, 2024
IJOL
pushed a commit
to BITVAX/server-tools
that referenced
this pull request
Aug 19, 2024
psugne
pushed a commit
to versada/server-tools
that referenced
this pull request
Oct 9, 2024
SiesslPhillip
pushed a commit
to grueneerde/OCA-server-tools
that referenced
this pull request
Nov 20, 2024
Syncing from upstream OCA/server-tools (13.0)
yibudak
pushed a commit
to yibudak/server-tools
that referenced
this pull request
Dec 23, 2024
yibudak
pushed a commit
to yibudak/server-tools
that referenced
this pull request
Dec 23, 2024
yibudak
pushed a commit
to yibudak/server-tools
that referenced
this pull request
Dec 23, 2024
aaltinisik
pushed a commit
to altinkaya-opensource/server-tools
that referenced
this pull request
Jan 13, 2025
aaltinisik
pushed a commit
to altinkaya-opensource/server-tools
that referenced
this pull request
Jan 13, 2025
aaltinisik
pushed a commit
to altinkaya-opensource/server-tools
that referenced
this pull request
Jan 13, 2025
oerp-odoo
pushed a commit
to versada/server-tools
that referenced
this pull request
Feb 14, 2025
BhaveshHeliconia
pushed a commit
to HeliconiaIO/server-tools
that referenced
this pull request
Feb 24, 2025
BhaveshHeliconia
pushed a commit
to HeliconiaIO/server-tools
that referenced
this pull request
Aug 19, 2025
BhaveshHeliconia
pushed a commit
to HeliconiaIO/server-tools
that referenced
this pull request
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revisiting the
base_multi_imageuninstall hook. It turns out we do need to use the env, because the registry is actually returning a MetaModel here. This can be seen in:MetaModelinstead of alist. It still wanted theBaseModel.I switched up to the env in the second commit here, then rebuilt the product-attribute PR to yield a positive Travis.
I'm curious if there's a way to test this directly in this module. The whole double PR to fix an issue that made it to a production branch isn't awesome, so I'd like to figure out how to nip this in the butt forever with a test. Best I can think of though is a
test_module, which really isn't that much better than just requiring some other module that already exists IMO.