def onchange_get_datas(self, cr, uid, ids, image_logo_attachment_id, context=None):
# import pdb;pdb.set_trace()
if image_logo_attachment_id:
image_logo_datas = image_logo_attachment_id.datas
else:
image_logo_datas = False
return {'value':{'image_logo_datas':image_logo_datas}}
This is my cod ^
and the fields are :
'image_logo_attachment_id': fields.many2one('ir.attachment', 'Image logo attachment',
help='Technical field to store image in filestore'),
'image_logo_datas': fields.related('image_logo_attachment_id', 'datas', type='binary',
string='Image logo datas', Class=".oe_avatar"),
please provide us the xml view field definition to check the onchange arguments to provide you with a full answer
<field name="image_logo_datas" nolabel="1" widget='image' class="oe_avatar" on_change="onchange_get_datas(image_logo_datas)"/>