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 .
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
andmail.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.