Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
14828 Weergaven

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


Thanks

Avatar
Annuleer
Beste antwoord

Hi,

You can try like this,

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

Thanks

Avatar
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
dec. 24
4370
1
nov. 24
3135
2
apr. 23
18118
1
mrt. 23
2406
4
aug. 24
24225