Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
10749 Переглядів

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

Related Posts Відповіді Переглядів Дія
2
січ. 22
13645
2
лип. 25
4510
2
груд. 24
7680
2
лист. 24
28442
2
трав. 24
7418