Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4147 มุมมอง

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:


                // invoiceId 
final 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);

// invoiceTaxId
final 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);

                // itemId
final 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);


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
java api แก้ไขแล้ว
1
มี.ค. 15
6202
0
มิ.ย. 21
2385
OpenERP Java API แก้ไขแล้ว
2
พ.ย. 20
14667
0
เม.ย. 18
6679
0
มี.ค. 15
5875