|
@ -20,7 +20,7 @@ def pre_init_hook_for_submodules(cr, model, field): |
|
|
Binary field that had the images in that :param:`model`, like |
|
|
Binary field that had the images in that :param:`model`, like |
|
|
``image``. |
|
|
``image``. |
|
|
""" |
|
|
""" |
|
|
env = api.Environment(cr, SUPERUSER_ID, dict()) |
|
|
|
|
|
|
|
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
|
|
with cr.savepoint(): |
|
|
with cr.savepoint(): |
|
|
table = env[model]._table |
|
|
table = env[model]._table |
|
|
column_exists = table_has_column(cr, table, field) |
|
|
column_exists = table_has_column(cr, table, field) |
|
@ -76,9 +76,11 @@ def uninstall_hook_for_submodules(cr, registry, model): |
|
|
Model technical name, like "res.partner". All multi-images for that |
|
|
Model technical name, like "res.partner". All multi-images for that |
|
|
model will be deleted |
|
|
model will be deleted |
|
|
""" |
|
|
""" |
|
|
Image = registry["base_multi_image.image"] |
|
|
|
|
|
images = Image.search([("owner_model", "=", model)]) |
|
|
|
|
|
images.unlink() |
|
|
|
|
|
|
|
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
|
|
|
|
|
with cr.savepoint(): |
|
|
|
|
|
Image = env["base_multi_image.image"] |
|
|
|
|
|
images = Image.search([("owner_model", "=", model)]) |
|
|
|
|
|
images.unlink() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def table_has_column(cr, table, field): |
|
|
def table_has_column(cr, table, field): |
|
|