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
- Comptabilité
- Inventaire
- PoS
- Projet
- MRP
Cette question a été signalée
3581
Vues
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire