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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- Project
- MRP
신고된 질문입니다
1
회신
3481
화면
# 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"),
},
],
)
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
1
8월 24
|
4579 | ||
|
2
5월 22
|
10345 | ||
|
0
3월 15
|
3266 | ||
|
1
10월 24
|
2589 | ||
|
3
2월 23
|
6874 |