Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3398 Lượt xem

I created an invoice using xml api with a rails (ruby) app.

@models.execute_kw(@db, @uid, @password, "account.invoice", "create", {

  partner_id: any_customer_id,

  date_due: Time.now.strftime("%Y-%m-%d"),

  date: Time.now.strftime("%Y-%m-%d"),

  date_invoice: Time.now.strftime("%Y-%m-%d"),

  amount_untaxed: 15.0,

  amount_untaxed_signed: 15.0,

  amount_taxed: 3.0,

  amount_taxed_signed: 3.0,

  amount_total: 18.0,

  amount_total_signed: 18.0,

  amount_total_company_signed: 18.0,

  state: "paid",

  residual: 18.0,

  residual_signed: 18.0,

  residual_company_signed: 18.0

})


The resulting invoice has no number in it (no number in the invoice pdf or in the odoo interface).

Is there anything special I need to do to generate this number based on odoo numbering sequence ?

Also, where can I find a global listing of all models and their attributes / methods accessible through API ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You need to validate the invoice to give it a sequenced number. All draft invoices have no number.

Of course, you'll need the created invoice in scope to do this, so it may be something you do outside of the call in your original post:

invoice.signal_workflow('invoice_open')
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 19
3871
0
thg 5 19
3972
1
thg 2 25
1269
0
thg 11 24
1183
1
thg 6 24
1439