Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
10753 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
2
gen 22
13646
2
lug 25
4515
2
dic 24
7687
2
nov 24
28443
2
mag 24
7420