0

当我提交包含 type= 文件输入的表单时出现此错误:

<input type="file" t-attf-class="form-control o_website_form_input #{error.get('attachment_ids') and 'is-invalid' or ''} " id="attachment_ids"
                       name="attachment_ids" t-att-value="attachment_ids"
                       multiple="true"/>

我正在从 website_sale 模块中的控制器更新 address(self, **kw) 方法,此行导致错误:

'attachment_ids': base64.encodestring(kw.get("attachment_ids").read()),

这是模型中字段 attachment_ids 的定义:

attachment_ids = fields.Many2many('ir.attachment', string='Files', required=True)

谁能帮帮我,我一直在寻找解决方案很长一段时间,直到现在一无所获

4

0 回答 0