Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
14822 Näkymät

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


Thanks

Avatar
Hylkää
Paras vastaus

Hi,

You can try like this,

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

Thanks

Avatar
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
jouluk. 24
4364
1
marrask. 24
3121
2
huhtik. 23
18114
1
maalisk. 23
2400
4
elok. 24
24203