Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3804 Vizualizări

In the recruitment module, when a job applicant submits the job form with file attachments, the odoobot attaches the files to the new applicant. How can I achieve the same thing via the Odoo External API?

version 13.0

Imagine profil
Abandonează
Autor Cel mai bun răspuns
# I solved this problem this way:

from base64 import b64encode

data = file.read()

self.models.execute_kw(
db,
uid,
password,
"ir.attachment",
"create",
[
{
"res_model": model_name,
"res_id": model_id,
"type": "binary",
"name": name,
"display_name": name,
"mimetype": mimetype,
"datas": b64encode(data).decode("utf-8"),
},
],
)
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
aug. 24
6075
2
mai 22
11890
0
mar. 15
3679
1
oct. 24
3416
3
feb. 23
7380