Hello everyone !
First the code :
class myClass(models.Model):
_name='myModule.myClasse' image=fields.Binary(compute='_getBase64Image') @api.one def _getBase64Image(self): self.image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAC....." |
The Views :
- In the form, i use :
<field name="image" widget="image"/> |
- In the kanban, i use :
<div class="o_kanban_image"> <img t-att-src="kanban_image('myModule.myClass', 'image', record.id.value)"/> </div> |
So, first is my syntax ok for base64 image in a fields.Binary ? Because even if i send a base64 of a 128*128px it doesn't appear.
Then, i would like to show the "image" field in form view as original size but scaled in kanban view to fit in the kanban. Does the environnement manage this alone or i have to rework the image first ?
Actually this code doesn't work : in kanban view i have the little pictogram that shows that it can't display the image.
Thank you in advance ! :) .
Good afternoon !