Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3991 Vizualizări


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?

Imagine profil
Abandonează
Autor Cel mai bun răspuns

I did it in write method

Imagine profil
Abandonează
Cel mai bun răspuns
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')
Imagine profil
Abandonează


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

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

Related Posts Răspunsuri Vizualizări Activitate
0
dec. 24
1335
1
mar. 23
6530
0
oct. 21
2555
2
mai 20
12124
2
dec. 17
4218