Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I got this Code from Base code itself, anyway this will be helpful for those who searching for default image in odoo 9.
from openerp.tools import openerp,image_colorize, image_resize_image_big
photo = fields.Binary(string="Image to upload", default=lambda self:self._get_default_image())
def _get_default_image(self, colorize=False):
image = image_colorize(open(openerp.modules.get_module_resource('base','static/src/img', 'avatar.png')).read())
In Xml, should specify widget="image" for showing image in Form.
<field name="photo" widget="image" />
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
|Asked: 7/5/16, 8:33 AM|
|Seen: 1533 times|
|Last updated: 7/5/16, 9:13 AM|