Skip to Content
Menu
This question has been flagged
2 Replies
14509 Views

I am not able to write(update) data on product template object, here is the code which i am trying : to note binary conversion is working but while persisting data its showing can't adapt type error.

product_template_obj.set_images(cursor, user, product_template.id.id, {'image': tools.image_resize_image_big(image_binary)}, context=context)

its thowing error for this above statement

ProgrammingError : can't adapt type 'product.template'

Avatar
Discard

product_template.id.id or product_template_id.id ???????????

Best Answer

You used twice product_template.id.id just use product_template.id

 and use the write method to set the image.

Avatar
Discard