跳至内容
菜单
此问题已终结
1 回复
10772 查看

I have a one2many field to ir.attachment, 

i want to get file from my computer and upload it to the filed thank you 

attachment = fields.One2many('ir.attachment', 'res_partner_id', string='Attachment', compute='_get_file')

形象
丢弃
最佳答案

Just Add
Field:
attachment_ids
Type: many2many
Widget: many2many_binary

Widget logic: odoo-13.0\addons\web\static\src\js\widgets\attach_document.js


Example:


model.py

attachment_ids = fields.Many2many("Add Attachments")

view.xml

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


形象
丢弃
编写者

i want a computed one2many attachment field and that attachments will upload them automatically, if you have any ideas. Thanks

相关帖文 回复 查看 活动
2
1月 22
13659
2
7月 25
4548
2
12月 24
7710
2
11月 24
28450
2
5月 24
7429