Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3801 Переглядів

 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.

Найкраща відповідь

Odoo stores all files as binary files in the binary field of your model whatever their extension was.
So in your same script that is used to create a record through the create ORM method you can send your pdf file data as binary to the create method with the field name.

* So just convert your file to binary and send it and Odoo will do the rest.



Happy to help :) an upvote will be awesome

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лип. 25
214
0
черв. 25
326
1
черв. 25
697
2
трав. 25
1261
1
трав. 25
751