Skip to Content
Menu
This question has been flagged
2 Replies
9180 Views

I have created field like <field name="attachment_ids"  widget="many2many_binary"/> in xml file

what i should write in py file for many2many_binary relation inside terms

'attachment_ids': fields.many2many('ir.attachment', 'message','message_id', 'attachment_id', 'Attachments'),

can any one plz explain total structure of py file of this in depth

Avatar
Discard
Best Answer

Refer the below link:-

https://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html/

fields.many2many('other.object.name', 'relation object', 'actual.object.id', 'other.object.id', 'Field Name')

https://www.odoo.com/forum/Help-1/question/Attach-many-files-in-a-binary-field-type-37823

 

Avatar
Discard
Best Answer

Python: 
attch_ids = fields.Many2many('ir.attachment', 'ir_attach_rel',  'record_relation_id', 'attachment_id', string="Attachments",
help="If any")

XML:
<field name="attch_ids" widget="many2many_binary"/>

Avatar
Discard