Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
3990 Переглядів


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?

Аватар
Відмінити
Автор Найкраща відповідь

I did it in write method

Аватар
Відмінити
Найкраща відповідь
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')
Аватар
Відмінити


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

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

Related Posts Відповіді Переглядів Дія
0
груд. 24
1334
1
бер. 23
6529
0
жовт. 21
2554
2
трав. 20
12124
2
груд. 17
4217