How to preview images after uploading in Odoo V10?

2019-08-08 16:39发布

问题:

There is ir.attachment model available for uploading URL and files but I want to upload images and that can be viewed on the uploading form UI-view.

Is there any way I can do it as I haven't found anything on this related to Odoo V10.

How can we solve this issue?

回答1:

odoo app available on odoo apps page please go throw this url may be it will help you [https://apps.odoo.com/apps/modules/category/Extra%20Tools/browse?search=image+preview] if this helped you please up-vote my answer



回答2:

You can try this:

Add this code in your .py

attachment = fields.Many2many("ir.attachment", string="Attachment")

and .xml

<field name ="attachment" widget="many2many_binary"/>

I hope it works for you.