Skip to Content
मेन्यू
This question has been flagged
2 Replies
4010 Views


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?

Avatar
Discard
Author Best Answer

I did it in write method

Avatar
Discard
Best Answer
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')
Avatar
Discard


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

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

Related Posts Replies Views Activity
0
दिस॰ 24
1346
1
मार्च 23
6536
0
अक्तू॰ 21
2563
2
मई 20
12128
2
दिस॰ 17
4222