Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- Project
- MRP
신고된 질문입니다
I got this Code from Base code itself, anyway this will be helpful for those who searching for default image in odoo 9.
In Header,
from openerp.tools import openerp,image_colorize, image_resize_image_big
In Py,
photo = fields.Binary(string="Image to upload", 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'))
In Xml, should specify widget="image" for showing image in Form.
<field name="photo" widget="image" />
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
1
3월 16
|
2002 | ||
|
2
8월 25
|
7430 | ||
|
5
12월 23
|
29409 | ||
|
1
7월 25
|
2005 | ||
|
2
11월 24
|
1078 |