Hi,
I'm using odoo 12,
I want to upload a single file .pdf through the API. Can you please explain to me how to do this in the most simple way without having any module attachments, if that's possible? If it's not possible then let me know a way that's possible to do that. I have the following code:
this.getBase64(this.state.selectedFile).then((data) => {
const param = [
[
{
res_model: "account_invoice",
res_name : this.state.selectedFile.name,
res_id: 95,
name: this.state.selectedFile.name,
datas: data,
type: "binary",
res_field : "pdf"
},
],
];
odoo.execute_kw("ir.attachment", "create", param);
});
});
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2623
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up