Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
14816 Zobrazení

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


Thanks

Avatar
Zrušit
Nejlepší odpověď

Hi,

You can try like this,

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

Thanks

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
pro 24
4361
1
lis 24
3120
2
dub 23
18114
1
bře 23
2400
4
srp 24
24200