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


I have binary field with attachment=true. All those files have been saved with name of binary field. I want that those files will be automatically save with the same name as res_name. How to do that?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I did it in write method

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
You can achieve it by doing the following:

attachment_id = fields.Many2one('ir.attachment', string='Attachment')

attachment_fname = fields.Char('Attachment Filename', related='attachment_id.name')
อวตาร
ละทิ้ง


<field name="attachment_fname" invisible="1"/>

<field name="attachment_id" filename="attachment_fname"/>

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ธ.ค. 24
1329
How to set attachments to public? แก้ไขแล้ว
1
มี.ค. 23
6524
0
ต.ค. 21
2551
2
พ.ค. 20
12120
2
ธ.ค. 17
4211