We have a python script that adds a new entry on an Odoo web database, we want that same script to upload a pdf (stored locally in the computer) to a certain field of and to be displayed as a pdf widget.
Usually we use the Odoo function "write" to add the data to the fields but we don't know how to do that with a pdf.
Please share your script. Also post some details like how or from where you are fetching the PDF and posting to Odoo.