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

I have a custom form on my website which visitors fill out and this creates an Opportunity in Odoo.

It all works great, but I have a custom field called "Certificate" which visitors are supposed to upload.  If they do, I'd like this attached to the Chatter in the Opportunity so users can quickly reference it.

Is this possible?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Something like this seems to work, it is based on visitors registering and uploading a Tax Exemption Certification, stored in the x_tax_exemption field:


Code:

for record in records:
attachment = env['ir.attachment'].create( \
{'name': 'Tax Exemption',
'type': 'binary',
'datas': record.x_tax_exemption,
'res_model': 'crm.lead',
'res_id': record.id,})
อวตาร
ละทิ้ง