Hi! I was able to create an invoice with the API.
The documentation I'm using is this one:
https://www.odoo.com/
documentation/10.0/api_
integration.html
The problem is that taxes aren't being calculated. Also the Invoice is created as draft so I don't know how to call a "confirm" method to achieve this.
This is the code snippet I'm using:
// invoiceIdfinal Integer id = (Integer) models.execute("execute_kw", asList(db, uid, password,"account.invoice", "create",asList(new HashMap() {{put("name", "New Partner");put("date", "2018-04-13");put("account_id", 595);put("partner_id", 7);}})));System.out.println("invoiceId:" + id);// invoiceTaxIdfinal Integer taxId = (Integer) models.execute("execute_kw", asList(db, uid, password,"account.invoice.tax", "create",asList(new HashMap() {{put("invoice_id", id);put("tax_id", 1);put("name", "IVA 21% (Bienes)");put("account_id", 595);}})));System.out.println("taxId: " + taxId);
// itemIdfinal Integer itemId = (Integer) models.execute("execute_kw", asList(db, uid, password,"account.invoice.line", "create",asList(new HashMap() {{put("invoice_id", id);put("name", "LICENSE");put("account_id", 595);put("price_unit", 49.99d);put("invoice_line_tax_ids", asList(taxId));}})));System.out.println(itemId);