I have a DB v14, from which I want to export the chatter for all my products, including the attached documents, which are the technical info of that specific product. I already managed to export all the PDF files from the old DB, but now I want to upload them to a new DB v17, however, after trying to post a message using a Python script via Odoo-bin shell, I haven't been able to actually display the files corresponding to each of my products, which are both the same in the old and the new DB.
With the following code I create a test message for all my products, but they are not being displayed in the chatter's frontend.
admin_partner = env.ref('base.user_admin').partner_id
for product in env['product.template'].search([]):
product.message_subscribe(partner_ids=[admin_partner.id])
product.message_post(
body="test message",
message_type='comment',
subtype_xmlid='mail.mt_note'
)