I'm working on v7. I'm trying to set a default image "my_image.png" for a binary field. If the user opens the form, "my_image.png" must be visible until the user changes it.
My code:
def _get_default_signature(self, cr, uid, context=None):
import base64
f = open('static/src/img/my_image.png')
image = base64.encodestring(f.read())
f.close()
return image
_columns = {
'signature': fields.binary('Signature'),
}
_defaults = {
'signature': _get_default_signature,
}
I'm not able to show "my_image.png" as the default value for the field signature. Can anyone help me here, please?