Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


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

on 2/23/16, 2:44 AM 357 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'

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

Jusab Sida (jsi)
on 2/23/16, 4:31 AM
Krupesh Laiya
On 2/23/16, 7:29 AM

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

 and use the write method to set the image.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 2/23/16, 2:44 AM
Seen: 357 times
Last updated: 2/23/16, 7:29 AM