Prerequisite
I made all the test in v15 so it should work for all sub versions (15.0, 15.1 and 15.2).
Be in debug mode.
Have an import compatible file of some attachments.
Studio.
Use case
It often happens that we want to make a mass import of attachments in Odoo (in the ir.attachment model) directly but we are stuck very fast by the fact that the Resource Model (res_model) or Resource ID (res_id) is a read only field and that it cannot be altered in a standard version.
You may also use this third-party app - https://apps.odoo.com/apps/modules/15.0/cloud_base - to move attachments between folders and, hence, between linked objects. It is as simple as a mere drag and drop or choosing a field in the popup wizard.