please provide me simple example
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
in py
import
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())
@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
<field name="photo" widget="image" /> |
if in case you need a any other image as default add png image in static/src/img and change the below py code
image = image_colorize(open(openerp.modules.get_module_resource('your_module','static/src/img', 'imagename.png')).read()) |
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
RekisteröidyAiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
---|---|---|---|---|
|
0
tammik. 16
|
3153 | ||
|
3
helmik. 20
|
1300 | ||
|
0
syysk. 16
|
3594 | ||
Problem on Installing Odoo 9.0
Ratkaistu
|
|
1
toukok. 15
|
3980 | |
|
1
lokak. 22
|
4200 |