Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3334 Prikazi


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
Opusti
Avtor Best Answer

I did it in write method

Avatar
Opusti
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
Opusti


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

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

Related Posts Odgovori Prikazi Aktivnost
0
dec. 24
716
1
mar. 23
5793
0
okt. 21
2166
2
maj 20
11588
2
dec. 17
3759