Skip to content

Commit

Permalink
[FIX] adapt to changes in binary attachment branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Sep 15, 2016
1 parent b42a94b commit 17bbab0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions base_multi_image/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ def pre_init_hook_for_submodules(cr, model, field):
# fields.Binary(), extract the binary content directly from the table
if column_exists:
extract_query = """
SELECT id, %%s, 'db', %(field)s
SELECT id, '%(model)s', '%(model)s,' || id, 'db', %(field)s
FROM %(table)s
WHERE %(field)s IS NOT NULL
""" % {"table": table, "field": field}
""" % {
"table": table,
"field": field,
"model": model,
}
image_field = 'file_db_store'
# fields.Binary(attachment=True), get the ir_attachment record ID
else:
Expand Down

0 comments on commit 17bbab0

Please sign in to comment.