how to add an image to a many2one field other than EHCS Many2one Dropdown Image
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- 项目
- MRP
此问题已终结
1
回复
1033
查看
Assuming you have a model named YourModel with a Many2one field named related_field and you want to display an image associated with each record selected in the related_field
in py:
image_field = fields.Binary(string="Image", attachment=True)
in xml:
div>
field name="image_field" widget="image" options='{"preview_image": "image_field"}'/>
/div>
/group>
/sheet>
/form>