コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3822 ビュー


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
1207
1
3月 23
6393
0
10月 21
2484
2
5月 20
12023
2
12月 17
4116