Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
4057 Представления


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
1389
1
мар. 23
6595
0
окт. 21
2610
2
мая 20
12165
2
дек. 17
4279