what does attachment=True do odoo 13

一世执手 提交于 2021-01-28 04:57:16

问题


I created a custom module in which I have this field

record_file = fields.Binary(string='file', attachment=True, help='Upload the file')

from what I understand attachment=True should save my images or pdfs to ir.attachment but am not seeing any there

am I doing something wrong


回答1:


You are not doing something wrong, ir.attachment records are hidden when the value of res_field (a Char field) is set.

When you upload the file and save, an attachment is created and the value of the res_field is set to record_file which makes it invisible under Attachments.

You can check that the methods _search and read_group was overridden to add res_field=False in the domain if not present.

Note that the default value for the attachment parameter is True so you do not need to useattachment=True.



来源:https://stackoverflow.com/questions/62905093/what-does-attachment-true-do-odoo-13

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!