Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3946 Zobrazení


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
Zrušit
Autor Nejlepší odpověď

I did it in write method

Avatar
Zrušit
Nejlepší odpověď
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
Zrušit


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

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

Related Posts Odpovědi Zobrazení Aktivita
0
pro 24
1322
1
bře 23
6504
0
říj 21
2546
2
kvě 20
12108
2
pro 17
4189