Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
10763 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
tammik. 22
13650
2
heinäk. 25
4526
2
jouluk. 24
7697
2
marrask. 24
28443
2
toukok. 24
7423