İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
10738 Görünümler

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')

Avatar
Vazgeç
En İyi Yanıt

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"/>


Avatar
Vazgeç
Üretici

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Oca 22
13633
2
Tem 25
4491
2
Ara 24
7669
2
Kas 24
28435
2
May 24
7407