使用浏览器打开文件对话框的 Odoo 文件上传

Odoo file upload with browser open file dialog

我在我的 Odoo form.view 中使用以下 XML 语句创建了一个智能按钮:

<div name="button_box" class="oe_right" position="inside">
    <button class="oe_inline oe_stat_button" name="upload_pictures" type="object" icon="fa-cloud-upload" string="Upload Pictures" />
</div>

在我的模型的 python class 中,我使用以下定义在单击智能按钮后执行某些操作。

@api.multi
def upload_pictures(self):
    ...

这工作正常,但我现在的问题是如何在单击我的智能按钮后启动浏览器弹出窗口 "open file ..." 并处理从我的 python [中的打开文件对话框中选择的文件] =24=] 定义?

非常感谢您的帮助!

您需要为此实现自定义小部件。对象按钮在服务器端而非客户端触发操作