تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
14812 أدوات العرض

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
ديسمبر 24
4360
1
نوفمبر 24
3110
2
أبريل 23
18109
1
مارس 23
2398
4
أغسطس 24
24196