Skip to Content
Menu
This question has been flagged
2 Replies
4150 Rodiniai


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?

Portretas
Atmesti
Autorius Best Answer

I did it in write method

Portretas
Atmesti
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')
Portretas
Atmesti


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

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

Related Posts Replies Rodiniai Veikla
0
gruod. 24
1495
1
kov. 23
6710
0
spal. 21
2674
2
geg. 20
12250
2
gruod. 17
4337