From 639b5a54d8f7e0f218a6c7454f160b2a11ac42ba Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 15 Sep 2016 15:19:48 +0200 Subject: [PATCH] [FIX] adapt to changes in binary attachment branch --- base_multi_image/hooks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base_multi_image/hooks.py b/base_multi_image/hooks.py index 17e7a9618..c92691f12 100644 --- a/base_multi_image/hooks.py +++ b/base_multi_image/hooks.py @@ -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: