Attach product pdf to purchase order automatically

How can I configure Dolibarr to automatically attach documents (pdf, drawings, etc) to a new purchase order. The documents have already uploaded to the product.
If there’s not default function to do that, what files/functions can I modify in order to obtain that?
Thank you

I made this for a customer some years ago. Will look into it how it was done.
I think I used a hook. But maybe there is a module in the store.

If you can tell me what files I need to modify, I can do it by myself.

HI,
try to see if this module is right for you