Search code examples
messageattachmentforeign-key-relationshipodoo-8

relations between ir_attachment and mail_messages in odoo 8


I tried to get relations between messages and ir attachment using psql, bu didn't find anything yet. i have message ids in mail_messages and attachment ids in ir_attachment. but i couldn't find which message has which attachment, like foreign key relation ship... any solution .


Solution

  • I have made my comments as below , kindly request you to find it as below it will help in your case:

    What is the Relation Between ir.attachment and mail.message

    Well ir.attachment and mail.message have Many2many Realtion.

    You can visualize it in ODOO from here and from ir.model in ODOO view also.

    For viewing this relation records look-up the table_name(message_attachment_rel) into pgadmin created by this relation or just connect with psql, type \c your_db_name and \dt .

    In side the column1 you will find the Ids for mail.message(message_id) and in the column2 the Ids ir.attachment(attachment_id) .

    I hope after visiting all these link your query will definitely solved.