跳至内容
菜单
此问题已终结
2 回复
3881 查看


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"/>

相关帖文 回复 查看 活动
0
12月 24
1276
1
3月 23
6448
0
10月 21
2515
2
5月 20
12058
2
12月 17
4159