如何在Odoo V10上传后预览图像? [英] How to preview images after uploading in Odoo V10?

查看:1243
本文介绍了如何在Odoo V10上传后预览图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ir.attachment 模型可用于上传网址和文件,但我想上传图片,可以在上传表单的UI视图中查看。

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.

我有什么方法可以做到,因为我没有找到与Odoo V10相关的任何内容。

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

< a href =https://i.stack.imgur.com/DL7j2.png =nofollow noreferrer>

我们如何解决此问题?

推荐答案

你可以试试这个:

在你的.py

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

和.xml

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

我希望它适合你。

这篇关于如何在Odoo V10上传后预览图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆