Reputation: 769
Hi I have a custom class with 3 images:
class project_images(osv.osv):
_name = 'project.images'
_description = "Project Images"
def _get_image(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for obj in self.browse(cr, uid, ids, context=context):
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
_columns = {
'name': fields.char('Omschrijving',help="Omschrijving/naam van de foto."),
'image_alt': fields.text('Opmerking', help="In dit veld kan meer informatie over de afbeelding gegeven worden."),
'image':fields.binary('Foto', required=True),
'image_medium':fields.function(_get_image, type="binary", multi="_get_image",string='Image Medium',
store={
'project.images': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized image of the project. It is automatically resized as a 64x64px image, with aspect ratio preserved. Use this field anywhere a small image is required."),
'image_small':fields.function(_get_image, type="binary", multi="_get_image",string='Image Small',
store={
'project.images': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
},
help="Small-sized image of the project. It is automatically resized as a 64x64px image, with aspect ratio preserved. Use this field anywhere a small image is required."),
'project_id':fields.many2one('project.project','Project')
}
project_images()
When I want to add an image to the kanban view this only works with the 'image_small' field as in the code below.
<img t-att-src="kanban_image('project.images', 'image_small', record.raw_value)" class="oe_kanban_image_inherit"/>
If I replace this with below code it doens't work... Any ideas?
<img t-att-src="kanban_image('project.images', 'image_medium', record.raw_value)" class="oe_kanban_image_inherit"/>
Upvotes: 1
Views: 2159
Reputation: 304
have you import image_medium in outside kanban ? please paste your full kanban view xml.
Upvotes: 1