Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
10780 มุมมอง

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
13662
2
ก.ค. 25
4563
2
ธ.ค. 24
7714
How to ORDER BY? [Odoo 10] แก้ไขแล้ว
2
พ.ย. 24
28456
2
พ.ค. 24
7432