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
- Contabilità
- Magazzino
- PoS
- Progetti
- MRP
La domanda è stata contrassegnata
3578
Visualizzazioni
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati