Odoo Help

2

0
2 Answers
0
Avatar

kirubanidhi India

--kirubanidhi--

5066
| 6 2 8
pondicherry, India
--kirubanidhi--


kirubanidhi India
7/26/16, 9:40 AM

Hai,

In odoo 9 we Specify these header file

from openerp.tools import DEFAULT_SERVER_DATE_FORMAT,image_colorize, image_resize_image_big

Py file:

stud_image = fields.Binary('Photo', default=lambda self:\

self._get_default_image())

@api.model

def _get_default_image(self, colorize=False):

image = image_colorize(open(openerp.modules.get_module_resource('base',

'static/src/img', 'avatar.png')).read())

return image_resize_image_big(image.encode('base64'))

0
OpenGest.Solutions France
7/26/16, 1:31 PM

You can maybe follow the res_partner code:

http://gitlab.opengest.solutions/opengest/odoo/blob/9.0/openerp/addons/base/res/res_partner.py#L257

image_medium = openerp.fields.Binary("Medium-sized image", attachment=True,

help="Medium-sized image of this contact. It is automatically "\

"resized as a 128x128px image, with aspect ratio preserved. "\

"Use this field in form views or some kanban views.")

http://gitlab.opengest.solutions/opengest/odoo/blob/9.0/openerp/addons/base/res/res_partner.py#L290

1 Comment
OpenGest.Solutions France
7/26/16, 1:32 PM
Ask a Question
Writer
Keep Informed
2 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now