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:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
3432
أدوات العرض
# 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
أغسطس 24
|
4475 | ||
|
2
مايو 22
|
10163 | ||
|
0
مارس 15
|
3232 | ||
|
1
أكتوبر 24
|
2524 | ||
|
3
فبراير 23
|
6816 |