Skip to Content
मेन्यू
This question has been flagged
2 Replies
14804 Views

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


Thanks

Avatar
Discard
Best Answer

Hi,

You can try like this,

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

Thanks

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
2
दिस॰ 24
4356
1
नव॰ 24
3103
2
अप्रैल 23
18104
1
मार्च 23
2398
4
अग॰ 24
24182