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

Hello Dear i want to add attachment field in exiting odoo view can you help me how i can do that.


Thanks

アバター
破棄
最善の回答

Hi,

You can try like this,

attachment_id = fields.Many2one('ir.attachment', string="Attachment", required=True)

Thanks

アバター
破棄
最善の回答

I am not sure I correctly understand your question but attachment stored in ir.attachment model.
There is an easy way to an attachment on any model by the chatter
for that you have to inherit model from mail.thread and add related fields (message_ids) on the view 

https://github.com/odoo/odoo/blob/12.0/addons/event/models/event.py#L81
https://github.com/odoo/odoo/blob/12.0/addons/event/views/event_views.xml#L273

アバター
破棄
関連投稿 返信 ビュー 活動
2
12月 24
4378
1
11月 24
3149
2
4月 23
18129
1
3月 23
2417
4
8月 24
24247